Apache not recognising my .php files.

Posted by SuperSub, 06-29-2008, 06:43 AM
Hey guys, Yesterday I was told by my hosting provider that my machine was at kernel panic, so they restarted it and I restarted my webserver (Apache). I created a sub folder as I wanted to install a PHP script, so I created the folder using FTP and uploaded all of the script files. The problem is, when I now visit that URL, my browser is asking me to download the .php file instead of the webserver executing it: http://64.22.118.150/bhangra/ My web host said this: it sounds like you aren't loading your php module library in your apache.conf and/or not associating the .php extension. but I have no clue howto fix this. Any help would be appreciated. Thanks,

Posted by tajidyakub, 06-29-2008, 06:48 AM
Check the configuration and try to rebuild your apache, you could do this through WHM (easyapache).

Posted by Steve_Arm, 06-29-2008, 06:49 AM
You need to add this: AddType application/x-httpd-php .php somewhere in your httpd.conf file.

Posted by SuperSub, 06-29-2008, 07:18 AM
Steve, I tried this but it is still not working. The steps I took: Opened PuTTY and logged in. cd /usr/local/apache/conf/ cp httpd.conf httpd.conf.bak pico httpd.conf I added the line, saved and exited. Logged into WHM and restarted the webserver. Double checked I had saved httpd.conf file, I had. Funny thing is, that it recognises my .php files in root, example this works: http://64.22.118.150/contact.php But nothing in my subfolder works Any other ideas? Last edited by SuperSub; 06-29-2008 at 07:21 AM.

Posted by synapse, 06-29-2008, 12:55 PM
Hello, What operating system is this? Was apache installed from a package (yum install, apt-get install, etc) or from source?

Posted by activelobby4u, 06-29-2008, 01:08 PM
In addition confirm whether there is any htaccess effect in bhangra directory. try mv .htaccess htaccess.bak if there is one existing

¿Fue útil la respuesta?

 Imprimir éste Artículo

Leer también

Script help with CSF - how to temporarily unblock IPs

Posted by sharmaine1111, 04-22-2009, 11:12 PMHello I'm trying to create a script or WHM plugin...

Soap

Posted by parag, 03-12-2010, 09:58 AMHello, I installed SOAP - which tells me it has installed...

WHM/Cpanel Exim issue - how to better secure a partially open relay

Posted by MnMNmN, 02-14-2008, 10:04 PMHi all, I have a WHM/CPanel server. I have done some...

Drop-down header (yahoo like?)

Posted by coume, 03-13-2010, 07:40 AMHello, I struggled to find the right title for the thread...

.htaccess & cpanel

Posted by compjab, 03-24-2007, 11:22 PMI've protected a directory with cPanel and the user/pwd...