I have a fresh Debian install with PHP5 and Apache 2. When I try to view PHP pages in a browser, my browser tries to download the PHP page and asks me what type of program I would like to use to open it. I would take this to mean that the server is not parsing the PHP and outputting text like it's supposed to. Any idea what might be the problem?
Thanks,
Jason
PHP files not being treated as PHP
Moderator: General Moderators
Initially, no configuration. Just did an apt-get install. Then I added something like this to my httpd.conf:
I did not test any PHP scripts until after the change was made. After I took the change out and restarted Apache, it still didn't work.
Code: Select all
<VirtualHost 127.0.0.1:80>
ServerName askeet
DocumentRoot "/home/sfprojects/askeet/web"
DirectoryIndex index.php
Alias /sf /usr/local/lib/php/data/symfony/web/sf
<Directory "/home/sfprojects/askeet/web">
AllowOverride All
</Directory>
</VirtualHost>Get rid of what you added there and try to add this instead:
Note that maybe you'll need to change it a bit. I assumed that you installed Apache in your C drive and named its folder "apache2". I also assumed that you installed PHP in your C drive and named its folder "php".
Code: Select all
<VirtualHost *:80>
ServerName localhost
DocumentRoot "c:/apache2/htdocs"
DirectoryIndex index.php index.html index.cgi index.htm default.htm default.html 403.htm
</VirtualHost>
LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .phpActually, I don't think it exists and that's probably my problem. Oren showed a way to add that in Windows. How would I do it on Linux?I'm not really a fan of apt-get when it comes down to configuring stuff... anyway, as oren already mentionned, where is the section that loads the module? and registers files with .php to application/x-httpd-php ?
I'm not familiar with debian but
There seem to be many many php packages like e.g. libapache2-mod-php5
exactly what did you install?JasonTC wrote:Just did an apt-get install.
There seem to be many many php packages like e.g. libapache2-mod-php5