LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-01-2005, 10:07 PM   #1
LLS
Member
 
Registered: Sep 2003
Location: North America
Distribution: FC6 FC7 F8
Posts: 75

Rep: Reputation: 15
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.
 
Old 06-01-2005, 10:52 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
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.
 
Old 06-02-2005, 10:40 AM   #3
LLS
Member
 
Registered: Sep 2003
Location: North America
Distribution: FC6 FC7 F8
Posts: 75

Original Poster
Rep: Reputation: 15
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
 
Old 06-02-2005, 03:34 PM   #4
LLS
Member
 
Registered: Sep 2003
Location: North America
Distribution: FC6 FC7 F8
Posts: 75

Original Poster
Rep: Reputation: 15
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Are PHP session variables held in memory when you leave a PHP site? Locura Programming 11 11-16-2008 08:37 PM
php5 apache2 mysql4 don't work, php does not seem to read php.ini atom Linux - Software 5 03-24-2005 11:05 AM
php apache or php cgi - php learner rblampain Linux - Security 3 12-17-2004 11:10 PM
PHP -- How to execute a shell script from PHP using FTP functions?? zoonalex Programming 3 07-29-2004 11:51 AM
Updating php 4.3.1 from tar and keeping current php configuration with mandrake 9.1 mrjeep Linux - General 0 04-02-2003 07:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration