Click to See Complete Forum and Search --> : php not being compiled by browser
Dutch Mafia-boy.
11-27-2003, 03:01 PM
I followed this installation tutorial :
http://www.onlamp.com/pub/a/php/2000/11/17/php_admin.html
However, php still isn't being loaded (or working). I
am using RedHat 9. Whenever I go to load a .php page
in my webroot, all i get is plain text on my browser
screen....php isn't being compiled bynthe browser.
Here's what I did:
I downloaded the tarball - php-4.3.4
./configure --with-httpd --with-mysql
make
make install
suggestions?
Thanks.
Adrian
sharth
11-27-2003, 03:47 PM
probably missing a few lines in your apache configuration... if that doesn't help, please post you apache httpd.conf.
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
LoadModule php4_module /location/of/this/file/libphp4.so
andycrofts
11-27-2003, 03:56 PM
(red hat)
in /etc/httpd/conf/httpd.conf, you've an AddType directive.
Just add the line as below (cut 'n' paste of my conf file)
That should do it. (well, that's how I do it!)
-Cheers
-Andy
#
# AddType allows you to add to or override the MIME configuration
# file mime.types for specific file types.
#
AddType application/x-tar .tgz
AddType application/x-httpd-php .php .htm .html
(Sharth! That'll teach me to have a smoke while I'm thinking about the answer!)
Dutch Mafia-boy.
11-27-2003, 04:32 PM
I also copied the php.ini.dist from the php-4.3.4 directory (install directory where I compiled from - which is located in my downloads folder - /downloads) to /etc, renamed the existing php.ini - php.ini.old and renamed php.ini-dist to php.ini
Do you want the php.ini also??
Dutch Mafia-boy.
11-27-2003, 04:50 PM
Ever since I added those "AddModule" lines - whenever i try to open up a .php file under my webroot - a dialogue box comes up asking me if I want to Open or Save.....
probably missing a few lines in your apache configuration... if that doesn't help, please post you apache httpd.conf.
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
LoadModule php4_module /location/of/this/file/libphp4.so
I tried searchimg my system for libphp4.so - but it couldn't find it....
Perhaps I should say that I completely un-installed the php rpm that came with RedHat 9 (php-4.2.2-17.2.i386) and installed the new one completely from source - php-4.3.4. I kinda think the libphp4.so was apart of the previous rpm package - which would explain it not being found on my system - so I should at least figure out how to install that - or how to install it from a source install...
Dutch Mafia-boy.
11-27-2003, 05:05 PM
Ever since I added those "AddModule" lines - whenever i try to open up a .php file under my webroot - a dialogue box comes up asking me if I want to Open or Save.....
probably missing a few lines in your apache configuration... if that doesn't help, please post you apache httpd.conf.
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
LoadModule php4_module /location/of/this/file/libphp4.so
I tried searchimg my system for libphp4.so - but it couldn't find it....
Perhaps I should say that I completely un-installed the php rpm that came with RedHat 9 (php-4.2.2-17.2.i386) and installed the new one completely from source - php-4.3.4. I kinda think the libphp4.so was apart of the previous rpm package - which would explain it not being found on my system - so I should at least figure out how to install that - or how to install it from a source install...
sharth
11-27-2003, 09:03 PM
well, you just need to get the libphp4 working...
Originally posted by Dutch Mafia-boy.
I tried searchimg my system for libphp4.so - but it couldn't find it....Are you using RPMs of Apache and MySQL?
Conventionally libphp4.so is placed in the modules sub-directory of Apache.
BTW, the PHP manual suggests this for configure
./configure --with-mysql=path/to/mysql. Please read the manual for relevant info.
regards
akr
j79zlr
11-29-2003, 10:36 PM
This might be a silly question, but did you restart apache after modifying it?
# killall httpd
# httpd
Dutch Mafia-boy.
11-30-2003, 12:11 AM
Thanks for all your help!
I didn't really figure out my problem .......it most likely had something to do with libphp4.so not being present. I also read a lot on the web about its best to have tarballs used with tarballs source instead of source apps mixed with rpms.....apache-rpm and php-tarball.
I unistalled Apache 2.0 - installed Apache 1.3 (source) and compiled in all the modules (OpennSSL, and the other one I can't remember to have dynamic support for Apache (mod_ssl).....so when I want to upgrade the next version of PHP, I can compile it dynamically - its called DSO support I think and the config file is called - apxs - most of you already probaly know this....I'm just babbling...
Anyways, I compiled PHP successfully because of DSO support....and all is working fine.