Dynadot โ€” .com Registration $8.99

PHP code not interpreted

Spacemail by SpaceshipSpacemail by Spaceship
Watch
Impact
26
Hi,

I have one issue, please give me a hint:

PHP 5.2.1 installed on WHM 10.8.0 cPanel 10.9.0-C9565

If I load a php file on browser, it gets loaded, but in HTML source I can see php code.
If I run in SSH "php info.php", the php code gets runn and normal output is generated.

I checked these lines in httpd.conf:
LoadModule php5_module libexec/libphp5.so
AddModule mod_php5.c
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


"php -v" returns:
PHP 5.2.1 (cli) (built: Apr 9 2007 10:38:29)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with Zend Extension Manager v1.2.0, Copyright (c) 2003-2006, by Zend Technologies
with Zend Optimizer v3.2.2, Copyright (c) 1998-2006, by Zend Technologies


On php.ini I have:
; Enable the PHP scripting language engine under Apache.
engine = "On" ;engine

I use long tags ("<?php").

I recompiled Apache and PHP few times, both from WHM and from SSH. I reinstalled Zend optimizer.

Please let me know if you have any hint.

Thanks.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
When installing PHP, did you choose the option to configure apache?

Check the end of your httpd.conf for this:

#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
PHPIniDir "C:/Program Files/PHP/"
LoadModule php5_module "C:/Program Files/PHP/php5apache2_2.dll"

#AddType application/x-httpd-php .php


#END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL

The critical parts being:
PHPIniDir "C:/Program Files/PHP/"
LoadModule php5_module "C:/Program Files/PHP/php5apache2_2.dll"

(obviously you need to use your paths, not mine)
 
0
•••
Sorry, forgot to mention, I'm running it on CentOS 4.
Modules are loaded (if I remove them from php.ini, I get another type of error, Apache does not know what to do with php files and return Internal server error).

LoadModule php5_module libexec/libphp5.so
AddModule mod_php5.c
 
0
•••
I think you may still need the PHPIniDir directive for Apache on Centos.
Also, of course check your error logs.
 
0
•••
On Linux php.ini is set at compilation time.

BUT, I found it :)

In php.ini I had this line:

engine = "On"

It should be without quotes :)

engine = On



Anyway, RCRiver, thank for your kindly help :)
 
0
•••
No problem, sorry my help was all wrong!
Anyway, I have learned from trying to help...
 
1
•••
Unstoppable Domains
Domain Recover
DomainEasy โ€” Payment Flexibility
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back