eville

Member
Jul 17, 2004
21
0
151
Hi Guys,

I am having any issiue with PHP websites. The scripts wont run. When I try to visit a page with a php file extension my browser attempts to download a copy of the php file (not display it within the browser like it should).

It calls it a type: type: application/x-httpd-php

I've attempted this with 5 different browsers and all come up with the same problem.

I rebuilt apache but the same problem occurs.

Does anyone have any idea's why this may be happening after a fresh install of Cpanel?
 

webignition

Well-Known Member
Jan 22, 2005
1,876
2
166
If this is following a fresh install, you might want to try a reinstall incase the install didn't go smoothly:

/scripts/upcp --force

If that doesn't help, check your Apache config in /usr/local/apache/conf/httpd.conf.

If you're using the PHP module, check that you have:

Code:
LoadModule php4_module libexec/libphp4.so
near all the other LoadModule directives, or similar if you are using PHP5 (somewhere near the top of the config!). If you are using phpsuexec (i.e. CGI mode and not module), ensure that this line is commented out if present.

Check also that Apache has the correct handlers. If it hasn't been told to parse PHP scripts with anything, it won't! In my config I have:

Code:
AddHandler application/x-httpd-php .php .php4 .php3
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .php3
AddType application/x-httpd-php-source .phps
AddType application/x-httpd-php .phtml
Action application/x-httpd-php5 "/cgi-sys/php5"
AddType application/x-httpd-php5 .php5
It is likely to be different for you unless you are running both PHP4 and PHP5 - check what PHP version(s) you are running and check that the config is right for you.

You should fine the handlers loitering around somewhere inside the <IfModule mod_mime.c> directive (or at least I do).
 

agressor

Active Member
May 15, 2005
34
0
156
Just rebuild apache. If the problem persist, type (as root, in ssh obvius):

php -i | grep php.ini

and this give u the path of php.ini

Delete the line of Zend (if this exist) or other module added in php.ini. Remembser this stay in the last of file. and restart httpd

httpd restart


Sorry for my bad english.
reggards
 

eville

Member
Jul 17, 2004
21
0
151
Hi,

I've been working on getting Apache / PHP working again and have followed some of your advice. The main problem we've been having so far is that the LoadModule line actually creates an error when httpd is run:

Invalid command 'LoadModule', perhaps mis-spelled or defined by a module not included in the server configuration

(It fails on the LoadModule line for PHP.)

For whatever reason, Cpanel isn't building Apache with module support. Any ideas?
 

AndyReed

Well-Known Member
PartnerNOC
May 29, 2004
2,217
4
193
Minneapolis, MN
Murtaza_t, agressor, dave9000, and webignition provided good information to help you solve this issue. Thank you, guys :) Well; since none of these suggestions worked, I suggest you hire a sys admin. I am really amazed that you've been working on this issue since Febraury 19th. :eek:
 

eville

Member
Jul 17, 2004
21
0
151
dave9000 said:
log in as root

then

rm -fr /home/cpapachebuild

then

/scripts/easyapache

select option 1 ,compile apache and see if php works then


Thanx dave9000. I tried that but the problem is still here. I'm going to try to play around with the httpd file a little more. If i can't get it fixed by Saturday i'm just going to get some support from Cpanel.


AndyReed: thanks for thanking the people that helped me. Just some advice for the future though. Concluding other people's efforts without helping yourself while pluging your own services does not exactly equate to good salesmanship qualities.
 

tuxdesk

Well-Known Member
Oct 1, 2005
86
0
156
Please check the libphp4.so is existing in libexec. Sometimes it is existing there with another name. (like libphp4.so.1)
 

dave9000

Well-Known Member
Apr 7, 2003
888
1
168
arkansas
cPanel Access Level
Root Administrator
Off the wall thought here.

Was the OS installed with a minimun install or did the server get a full install of the OS?

Possible mutli httpd and php packages installed on the server and maybe the wrong one running or the wrong libs being linked in on compile ?
 

eville

Member
Jul 17, 2004
21
0
151
dave9000 said:
Off the wall thought here.

Was the OS installed with a minimun install or did the server get a full install of the OS?

Possible mutli httpd and php packages installed on the server and maybe the wrong one running or the wrong libs being linked in on compile ?


yea, the server was installed with Apache.


I've thought that could be causing the conflict. Because both apache's seem to be working. I actually set a page up on the first apache and it still seems to be working when you just type in the IP address of the page.