Apache, PHP, and disaster
Help! I've installed Apache 2.2 and PHP 5.2 and all my PHP is printed plain text!
Isn't this right?
# Use for PHP 5.x:
LoadModule php5_module modules/libphp5.so
AddHandler php5-script php
PHP and Apache are both running, appear to know about each other, but cannot get PHP files to be interpreted? This is an emergency help situation.
I'd say it happens to the best of us, but modesty precludes.
I threw into httpd.conf:
AddType application/x-httpd-php .php
PHPIniDir "/usr/local/apache2/php/php.ini"
one of them did it.
OK, PHP is now recognized. Now it seems to be the same problem as before-- I understand the Zend optimizer has to be turned off, was that in PHP.ini?
It is: zend_optimizer.enable_loader = 0
or zend_optimizer.optimization_level=0
would do it, but that (probably) wasn't the problem in this case.
The problem was short tags (<? ?>) in a custom theme-- turned short tags on for now in PHP.ini.
Now it seems there are still some settings wrong in httpd.conf... index.php shows up, but the document root isn't quite working right...
Set the document root (not server root!) to the very top directory you want the page served from. We'll deal with virtual domains some other time...
Help! I've installed Apache 2.2 and PHP 5.2 and all my PHP is printed plain text!
Isn't this right?
# Use for PHP 5.x:
LoadModule php5_module modules/libphp5.so
AddHandler php5-script php
PHP and Apache are both running, appear to know about each other, but cannot get PHP files to be interpreted? This is an emergency help situation.
I'd say it happens to the best of us, but modesty precludes.
I threw into httpd.conf:
AddType application/x-httpd-php .php
PHPIniDir "/usr/local/apache2/php/php.ini"
one of them did it.
OK, PHP is now recognized. Now it seems to be the same problem as before-- I understand the Zend optimizer has to be turned off, was that in PHP.ini?
It is: zend_optimizer.enable_loader = 0
or zend_optimizer.optimization_level=0
would do it, but that (probably) wasn't the problem in this case.
The problem was short tags (<? ?>) in a custom theme-- turned short tags on for now in PHP.ini.
Now it seems there are still some settings wrong in httpd.conf... index.php shows up, but the document root isn't quite working right...
Set the document root (not server root!) to the very top directory you want the page served from. We'll deal with virtual domains some other time...
Comments
Post new comment