Php-5????
I have spent most the day trying many different configuration options for my other-wise perfectly fine LAMP Server. I have scoured the forums and googled till I can't see straight, but failed to uncover the "secret " to getting PHP-5 to work like PHP-4. with Apache2. When I switched back to 4, everything returned to normal, web apps and programs worked as before. Can anyone point to the one thing I must be overlooking?
This is my setup, Fedora core3 Apache-2xx mysql-3xx php-4xx wanting to upgrade to 5xx. All rpms were originally removed and everything installed from source so I can use my own config options. My basic config routine was as follows. Download tar ball root # tar -zxvf php-5.0.4.tar.gz -C /usr/local/src cd # php-5.0.4 5. ./configure --prefix=/usr/local/apache/php5 \ --with-apxs2=/usr/local/apache/bin/apxs \ --with-config-file-path=/usr/local/apache/php5 \ --with-mysql=/usr/local/mysql 5. make 6. make install 7.# cp php.ini-dist /usr/local/apache/php5/lib/php.ini 8. Open up your apache config file # gedit /usr/local/apache2/conf/httpd.conf Add the following lines of code: LoadModule php5_module modules/libphp5.so "already there" AddType application/x-httpd-php php AddType application/x-httpd-php-source phps 9. Restart apache 2: /usr/local/apache2/bin/apachectl restart 10. Create a test PHP file showing phpinfo #gedit /usr/local/apache2/htdocs/phpinfo.php <?php phpinfo(); ?> 10. blank page Comment out php5 and enable php4 Back to normal!!!!!!!! I know yum and apt and rpm are good for some things but I desire complete control so I choose to install from source. Thanks in advance. |
PHP 5 has a PHP 4 compatibility mode (you should find it in the php.ini that comes with PHP 5). IIRC it will shut down some of the PHP 5 specific features to maintain compatibility, though. If you post exactly what's not working with PHP 5, though, someone may be able to help more. FWIW most sites I'm aware of are still on PHP 4 so you might want to stay with it unless there's some PHP 5 feature you really need.
|
Thanks for the input.
I have tried enabling zend compatibility mode but to no avail. .I still get no "php info page" and none of my php scripts will work with php5 . I also tried disabling selinux but that did not help either. It seems I ran across some line that had to be added to httpd.conf but can't seem to dig it up. Will post when solution is found |
Success
I was able to glean a solution out of these links---
http://www.aditus.nu/jpgraph/apache2suse.php http://cit.wta.swin.edu.au/cit/subje...ling-LAMP.html http://www.ilovett.com/blog/programm...debian-testing with the key additions being these--- Key directives added to httpd.conf # LoadModule foo_module modules/mod_foo.so #LoadModule php4_module modules/libphp4.so LoadModule php5_module modules/libphp5.so //automaticaly added during ./configure # AddType application/x-compress .Z AddType application/x-gzip .gz .tgz AddType application/x-httpd-php5 .php5 AddType application/x-httpd-php .php # AddHandler cgi-script .cgi .pl AddHandler php-script .php .htm .html AddHandler server-parsed .shtml AddHandler php5-script .php .htm .html # AddType text/html .shtml .php .php5 AddOutputFilter INCLUDES .shtml Excerpts of PHP INFO! # PHP Version 5.0.4 Configure Command './configure' '--prefix=/usr/local/lib/php5' '--with-mysql=/usr/local/mysql' '--with-apxs2=/usr/local/apache/bin/apxs' '--enable-force-cgi-redirect' Server API Apache 2.0 Handler mysql MySQL Support enabled Active Persistent Links 0 Active Links 0 Client API version 4.0.24 MYSQL_MODULE_TYPE external MYSQL_SOCKET /tmp/mysql.sock MYSQL_INCLUDE -I/usr/local/mysql/include MYSQL_LIBS -L/usr/local/mysql/lib -lmysqlclient SERVER["SERVER_SOFTWARE"] Apache/2.0.53 (Unix) PHP/5.0.4 And as a side, I did not have to enable the PHP4 compat. Thanks for the push. |
All times are GMT -5. The time now is 11:12 AM. |