Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> Php Won't Run From Cgi-bin, runs fine elsewhere; PL scripts run fine
cagey cretin
post Aug 26 2004, 04:25 PM
Post #1


./configure
***

Group: Members
Posts: 96
Joined: 9-September 03
Member No.: 1,413



Hey all, I hope someone can point me to the errors of my ways...

I'm running RH9, apache 2, php4, perl 5. I've set up ScriptAlias in httpd.conf for main & virtualhost sections.

I can call & run .pl scripts from the cgi-bin just fine. I can call php from anywhere, except the cgi-bin. blink.gif Why can't the php scripts run from there?

Thanks in advance,

Joe Wilk
Go to the top of the page
 
+Quote Post
chrisw
post Aug 27 2004, 09:26 AM
Post #2


RMS is my Hero
******

Group: Admin
Posts: 634
Joined: 27-September 02
From: Louisiana
Member No.: 5



did you move your php.exe file to your cgi-bin directory?


--------------------

Chris W.
Go to the top of the page
 
+Quote Post
cagey cretin
post Aug 27 2004, 11:55 AM
Post #3


./configure
***

Group: Members
Posts: 96
Joined: 9-September 03
Member No.: 1,413



Thanks Chris, and greetings from the Washington DC area!

In case I misunderstood, there is no php.exe on my machine. biggrin.gif

I moved an executable php file into the cgi-bin, made sure the ownership/permissions were the same as the working .pl files there. The php file does not run. I get a premature end of headers error message. The same file works just fine when placed in a directory under the document root (no error message & file executes).

Note: the cgi-bin is not under document root. Rather, it is under the users home directory next to the document root. I have set ScriptAlias to point to this path. Again, pl scripts are executed in this directory. ohmy.gif

Joe
Go to the top of the page
 
+Quote Post
chrisw
post Aug 28 2004, 02:36 PM
Post #4


RMS is my Hero
******

Group: Admin
Posts: 634
Joined: 27-September 02
From: Louisiana
Member No.: 5



sorry about the php.exe mistake...should have been just php

should be located in /usr/local/bin directory

how is php installed? from rpm or source?

what is the error that shows up when trying to run php from cgi-bin directory
could you paste the error here so we can look at it

and post your httpd.conf file also


--------------------

Chris W.
Go to the top of the page
 
+Quote Post
hughesjr
post Aug 29 2004, 04:35 AM
Post #5


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



On most standard installs, PHP is built as an Apache module, and PHP files won't run from the cgi-bin directory.

I don't run php files in my cgi-bin directory ... the next question is, do you have to have the PHP files in cgi-bin ... if not, put them elsewhere.

Here is a way to put a directory under cgi-bin that will allow php files to run there:
http://www.phpbuilder.com/tips/item.php?id=281

Or a way to make php work in the cgi-bin directory:
http://www.phpbuilder.com/tips/item.php?id=284

But you might have issues and break other parts of your cgi-bin ... so make sure to backup httpd.conf before you make changes...


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post
cagey cretin
post Aug 29 2004, 05:24 PM
Post #6


./configure
***

Group: Members
Posts: 96
Joined: 9-September 03
Member No.: 1,413



Thanks guys. I'm glad to know that it wasn't something I did.

Hughesjr, there is no need to run php from the cgi-bin; I just thought there was a reason to keep scripts in a folder not within the document root (I'm using ScriptAlias)...

Regards from almost nearly Washington DC,

Joe Wilk
biggrin.gif
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 24th October 2017 - 06:02 AM