Koobi Posted September 15, 2005 Share Posted September 15, 2005 i'm running Apache v2.x on linux the server itself is running, but apache doesn't recognize PHP files, it asks me if i want to download them. i had to reinstall Apache the other day because i made a mess of it while messing about with it. i've edited /etc/apache2/apache2.conf to add the following: AddType application/x-httpd-php .php and done a graceful restart with apache2ctl but it doesnt seem to work. i also don't have an .ht* file in any of my dir's that might tell .php files are anything but applicatoin/x-httpd-php files. i've tried everything i know but nothing works. either i've forgotten something, or apache is reading another .conf file from somewhere else...but other changes to apache2.conf seem to work. for example, i enabled the server-status and server-info options in that same conf file, and while server status doesnt seem to work, server-info gives a 403 header (forbidden) even when i run it as root via lynx. does anyone know if there's an apache tool that i can use which will tell me the order of the conf files being read? i'm open to any suggestions. i just can't figure out what i've missed out. i've done this a million times before :/ thanks. Quote Link to comment https://forums.phpfreaks.com/topic/2508-apache-wont-serve-php-files/ Share on other sites More sharing options...
effigy Posted September 15, 2005 Share Posted September 15, 2005 do you also have a LoadModule line? Quote Link to comment https://forums.phpfreaks.com/topic/2508-apache-wont-serve-php-files/#findComment-8326 Share on other sites More sharing options...
Koobi Posted September 15, 2005 Author Share Posted September 15, 2005 hey, thanks for the reply. all the paths i mention here are relative to /etc/apache2/ mods-available/ has php4.conf and php4.load mods-available/php4.conf has this: <IfModule mod_php4.c> AddType application/x-httpd-php .php .phtml .php3 AddType application/x-httpd-php-source .phps </IfModule> and mods-available/php4.load ahs this: LoadModule php4_module /usr/lib/apache2/modules/libphp4.so and mods-enabled/ has php4.conf and php4.load which are both symlinks to their counterparts in mods-available/ so everything seems in order to me. am i missing something? and all files in mods-enabled/ and mods-available/ are included via apache2.conf...but just to double-check things, i added the LoadModule directive for the PHP module in apache2.conf as well and when i tried graceful via apache2ctl, it throws an error saying that the module was already loaded. thanks for your time. Quote Link to comment https://forums.phpfreaks.com/topic/2508-apache-wont-serve-php-files/#findComment-8331 Share on other sites More sharing options...
effigy Posted September 15, 2005 Share Posted September 15, 2005 when php was configured, was the --with-apache2 switch used? Quote Link to comment https://forums.phpfreaks.com/topic/2508-apache-wont-serve-php-files/#findComment-8332 Share on other sites More sharing options...
Koobi Posted September 15, 2005 Author Share Posted September 15, 2005 it probably does. i haven't touched my PHP installation. i just reinstalled Apache, i did it again a few minutes ago but using Ubuntu's apt-get system, i didnt compile it manually. i tried this: php -in /etc/php4/apache2/ so that i could see the options but it still loads the php.ini from /etc/php4/cli/ got any ideas, effigy? thanks so far. Quote Link to comment https://forums.phpfreaks.com/topic/2508-apache-wont-serve-php-files/#findComment-8333 Share on other sites More sharing options...
Koobi Posted September 15, 2005 Author Share Posted September 15, 2005 ooops, i used -n instead of -c for PHP cli heh heh, anyway i just tried this: php -c /etc/php4/apache2/php.ini -i | grep -i apache and all i get is this: Configuration File (php.ini) Path => /etc/php4/apache2/php.ini so i guess i don't have that flag in my PHP install...but i don't recall touching my PHP installation in the last two days... in any case, as long as i have the proper AddType directive in apache2.conf, Apache shouldn't ask me if i want to download the PHP file, right? Quote Link to comment https://forums.phpfreaks.com/topic/2508-apache-wont-serve-php-files/#findComment-8334 Share on other sites More sharing options...
effigy Posted September 15, 2005 Share Posted September 15, 2005 correct. i have limited knowledge with installs, but all i can say is use the manual. mysql and apache should be installed first then php last, because it's configure options point at those two. i recommend compiling php against using a binary. Quote Link to comment https://forums.phpfreaks.com/topic/2508-apache-wont-serve-php-files/#findComment-8336 Share on other sites More sharing options...
Koobi Posted September 16, 2005 Author Share Posted September 16, 2005 yeah you're right. i will probably save more time if i did it all manually all over again. thanks for the reply anyway Quote Link to comment https://forums.phpfreaks.com/topic/2508-apache-wont-serve-php-files/#findComment-8362 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.