Help installing PHP 5 with other modules
Hi Guys,
I have Slackware 12 on this machine with recompiled httpd-2.2.4. I had installed PHP 5.2.5, but everytime I go to index.php, it displays the code instead of the page. I need to know if there are any dependencies or something else missing. In RedHat there is a command :" rpm -qa | grep php ", but I don't know how to do it here. In addition, I need the following requirements: # PHP 5 # PHP PEAR 5 including DB, Mail and Mail_Mime # PECL FileInfo # PHP mbstring - for improved UTF-8 sorting support (optional) # PHP MySQL 5 All you help to resolve this problem is greatly appreciated. In advanced, Thanks |
Did you add/uncomment "Include /etc/httpd/mod_php.conf" in your httpd.conf?
Brian |
HI Brian,
Thanks for your quick response. I looked under httpd.conf. I added "LoadModule php5_module modules/libphp5.so" and modified the index.html line and add index.php to the list. Besides the above, there is no other php word on the file. |
In my httpd.conf I have the following PHP related lines:
Code:
LoadModule php5_module modules/libphp5.so |
You should have a mod_php.conf file in /etc/httpd. This file will take care of loading the module and create the application types. The "Include" line I gave you will source that file so you don't need to add all that other stuff into your httpd.conf.
Brian |
PHP 5 Installation with Modules
Hi Guys,
Brian, I did it both way. I added all those modules on httpd.conf and disabled those and added "Include /etc/httpd/mod_php.conf". Unfortunelly, it didn't work either. Everytime I click on the index.php, now, it try to download the file instead of opening the page. Any other recommendation, please. Note: How do I know if the following are installed? # PHP PEAR 5 including DB, Mail and Mail_Mime # PECL FileInfo # PHP mbstring - for improved UTF-8 sorting support (optional) # PHP MySQL 5 |
Did you restart apache after modifying the files?
Brian |
Help PHP5 installation with modules
Yes I did. I even went further than that. I restarted the server.
|
I have the following line in addition to what gilead mentioned.
Code:
AddHandler php5-script php |
PHP5 problems
Hi Tux,
Thanks for your help. Yes, I tried that as well, but no luck. Any other recommendation. Thanks, |
This is what i had to do to make it work.
At the every end of my httpd.conf file i had a line Code:
#Include /etc/httpd/mod_php.conf went to my mod_php.conf file and edited Code:
LoadModule php5_module lib/httpd/modules/libphp5.so Code:
LoadModule php5_module /usr/lib/httpd/modules/libphp5.so Code:
cd /srv/httpd/htdocs and you should see a bunch of php info. Still doesn't work? One other thing i think i remember having to add was MultiViews to my document root options. Code:
<Directory "/srv/httpd/htdocs"> |
Everything should be set as agentc0re said except MultiViews option is not necessary:
Quote:
|
Quote:
|
You should not need to edit the mod_php.conf file to add "/usr/" before the module pathname, as you should have a line in your httpd.conf 'ServerRoot "/usr"' which tells apache where to look. You do not need the AddHandler line either.
Are you sure the index.php file contains valid php and that the opening and closing tags are correct? For example, there is a syntax error in agentc0re's test.php file, namely the space between < and ?php, so it will not run properly as written. Brian |
Quote:
Brian |
All times are GMT -5. The time now is 04:46 PM. |