[TriLUG] Strange PHP problem
Matt Nash
mattnash at intrex.net
Tue May 16 11:21:31 EDT 2006
Thanks for your quick response, Dave.
'/usr/sbin/apache2 -l' does not list php or php5. However,
'/usr/sbin/a2enmod php5' returns 'This module is already enabled!'.
When I look at the / directory listing on my browser, the bottom line
reads "Apache/2.0.55 (Ubuntu) PHP/5.1.2-1ubuntu2 Server at stewbuntu
Port 80"
Adding a LoadModule directive to apache2.conf for libphp5.so results in
a warning that the module is already loaded.
I tried copying php.ini to /etc/apache2/conf.d but restarting apache
resulted in an error indicating it couldn't parse the file.
There is an AddType line already in apache2.conf for php. Adjusting the
defined name of this type has no effect on the error message.
Dave Sorenson wrote:
> OK I realize it's bad form to respond to your own message, but make
> sure your httpd/conf.d/ has a php..ini file as well as that is where
> the libs are loaded and the addtype is defined.
>
> Dave Sorenson wrote:
>> Sounds like php is not being loaded with apache. Did the upgrade move
>> the location of PHP? Check your httpd.conf file and make sure the PHP
>> module is being loaded, then check the php.ini and make sure all the
>> paths to the PHP libs are correct.
>>
>> Matt Nash wrote:
>>> Hi folks,
>>>
>>> I am having a problem with my Apache2/PHP5 installation on a
>>> relatively new Ubuntu Dapper installation. I regularly perform a
>>> dist-upgrade and I believe it was after one of these that my
>>> problems began.
>>>
>>> I have been testing out SugarCRM as well as using phpmyadmin to
>>> manage MySQL, and these apps have been working just fine. Suddenly,
>>> the web server has started treating PHP scripts as files to download
>>> rather than scripts to execute. The browser says "You have chosen
>>> to open (...) which is a: application/x-httpd-php. What should
>>> Firefox do with this file?" There is empty space in place of the
>>> (...), not a file name.
>>>
>>> I have been through the Apache config file and added a ScriptAlias
>>> and Action directive to try to solve this, but nothing I do seems to
>>> have any effect. In fact, I can't seem to change the name of the
>>> MIME type in the error message-- if I change the line in
>>> apache2.conf to read "AddType application/x-httpd-phpBLAH .php" then
>>> the message that Firefox pops up still includes
>>> "application/x-httpd-php".
>>>
>>> To add to the confusion, if I type the full path to an actual PHP
>>> script into the address bar, I get a slightly different message:
>>> "You have chosen to open index.php which is a: PHP file"
>>>
>>> Even stranger, I still get the "What should Firefox do with this
>>> file?" message after I have stopped Apache.
>>>
>>> Thanks for any help you can offer.
>>>
>>> Matt
More information about the TriLUG
mailing list