Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2024-10-30 17:20:01

skewray
Member
From: Sunny Southern California
Registered: 2013-04-25
Posts: 200
Website

Maybe path weirdness with Txp/php/linux

I’ve been using the php line $command = parse( 'cgi-bin/<txp:yield />' ) ; to kick off C code that takes in user form inputs and then outputs calculation results. Been working great for 10+ years now. Today, I duplicated a working article and got the error output from php:

 <!-- error output:
sh: cgi-bin/mtf: No such file or directory
-->
<!-- return value: 127 -->

The original article still works fine. mtf is <txp:yield /> and exists in cgi-bin. The only way I can think of to get this error is if, for some reason, the execution path has been changed. Anyone have a clue? Should the path be specified in a more “absolute” way?

Edit: The article in question has “Draft” status, and I am running by hitting the “Draft” link in the admin panel. Does this preview mode do something odd with paths?

Last edited by skewray (2024-10-30 19:35:54)

Offline

#2 2024-10-31 17:37:55

skewray
Member
From: Sunny Southern California
Registered: 2013-04-25
Posts: 200
Website

Re: Maybe path weirdness with Txp/php/linux

For posterity: The preview links in Txp set the current working directory to /textpattern/, so creating a soft link from /textpattern/cgi-bin to ../cgi-bin fixes the issue.

Offline

#3 2024-10-31 20:41:23

etc
Developer
Registered: 2010-11-11
Posts: 5,210
Website GitHub

Re: Maybe path weirdness with Txp/php/linux

For the record: in txp 4.9 article preview happens on the public side, so no fix will be needed any more.

Offline

#4 2024-10-31 23:15:23

skewray
Member
From: Sunny Southern California
Registered: 2013-04-25
Posts: 200
Website

Re: Maybe path weirdness with Txp/php/linux

That’s definitely motivation to upgrade early. It appears that posterity won’t care all that much.

Last edited by skewray (2024-10-31 23:16:02)

Offline

Board footer

Powered by FluxBB