View Full Version : PHP Problem :confused:
Hi, On a new server (WHM/Cpanel), in cpanel it shows that PHP is installed but actually it seems that its not: opening php files it just shows the code !
Any solution ?
as always Help would be apprecited
Shyne 03-16-2002, 08:01 PM Try different tags such as <? ?> <?php ?>
Also make sure you have this line in your httpd.conf
AddType application/x-httpd-php .php
dhlsg 03-17-2002, 07:58 AM Thanks for that I had the same problem - Also using CPanel.
I fixed php, now I have a problem with .cgi's.
It appears as though .cgi is only working outside of the cgi-bin directory - Any clues as to how to get this working?
I get 500 Internal server error when accessing files within cgi-bin but outside of cgi-bin they run OK, so it's not a ASCII or permissions thing.
Anyone help?
Steve
Craig 03-17-2002, 02:37 PM Make sure these are in the httpd.conf
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Does that fix it?
Craig.
dhlsg 03-17-2002, 03:42 PM Hi Craig,
The php is fine now, I did add those lines.
The problem is now with cgi only running outside of the cgi-bin.
Any clues?
Cheers
Steve
mdrussell 03-17-2002, 04:19 PM Do you have suexec installed?
dhlsg 03-17-2002, 04:28 PM Hi Matt,
Not too sure, I think it is installed though, how do I check and fix the problem if it is? I tried running it via WHM last night but it didn't do anything.
Thanks for the help.
Steve
Originally posted by voxtreme-matt
Do you have suexec installed?
dhlsg 03-17-2002, 04:34 PM Just checked whereis suexec and it appears to be there, don't know if it's running though.
Steve
yeah the problem was they werent specified in the httpd, though first they were but i dont know what happend so i didnt check it anymore thinking that the problem should be something else.
!!! Beside adding the application types make sure to add the module lines too !!
Craig 03-17-2002, 08:10 PM To check if SuExec is enabled go into webhost manager as root and then click the "Enable/Disable SuExec" when you click this, it will tell you if SuExec is enabled or not..
If it IS enabled, run the "Fix insecure permissions on cgi scripts. (requires suexec)"
Also, if that does not help at all:
tail -f /usr/local/apache/logs/error_log
run a cgi script, check what error its giving.. paste it here :)
Craig.
dhlsg 03-18-2002, 12:07 AM Thanks Craig,
suexec is running (I should look at WHM before delving into shell sometimes :-)
Anyway, I to access the interchange cart in my cgi-bin to test, I get the following in my apache error logs
premature end of script headers: /home/user/public_html/cgi-bin/c$
File does not exist: /home/user/public_html/500.shtml
Any clues??
Thanks
Steve
Craig 03-18-2002, 12:21 AM Have you run "Fix insecure permissions on cgi scripts. (requires suexec)" ?
This is also in WHM or /scripts/fixcartwithsuexec ?
There are a load of "fix*something*withsuexec" scripts in /scripts/ check it out :)
Craig.
dhlsg 03-18-2002, 12:54 AM Thanks Craig,
Yes I did try through WHM first (Suexec) - No go.
I tried just about every fix* script too.
I also have more than just interchange to test cgi - so it's not interchange related as my other scripts don't run in cgi-bin either.
They do however run outside cgi-bin.
Hair pulling stuff. Any more suggestions?
Cheers
Steve
dhlsg 03-18-2002, 01:25 AM Yeh! Fixed!
Well one of those scripts fixed everything - Not too sure which one it was now :-) Thanks for the pointers - Still some hair intact.
Cheers
Steve
Craig 03-18-2002, 08:16 AM Glad i could help :)
Craig.
|