[TriLUG] Strange PHP problem
Matt Nash
mattnash at intrex.net
Tue May 16 11:35:58 EDT 2006
I'm pretty sure that all of those directives were already being
executed, but I created the file anyway. All I got was the same error
about the module already being loaded, and no change in my symptoms.
Dave Sorenson wrote:
> ACK!! my bad.. httpd/conf.d/ should have a php.conf file, not a copy
> of php.ini... here's what mine has in it:
>
>
> <BOP>
> # PHP is an HTML-embedded scripting language which attempts to make it
> # easy for developers to write dynamically generated webpages.
> #
>
> LoadModule php4_module modules/libphp4.so
>
> #
> # Cause the PHP interpreter to handle files with a .php extension.
> #
> AddType application/x-httpd-php .php
> # AddType application/x-httpd-php-source .phps
>
> #
> # Add index.php to the list of files that will be served as directory
> # indexes.
> #
> DirectoryIndex index.php
>
> <EOP>
> you'll need to make the changes for PHP5
>
> Sorry for the mislead... dang it I hate the start of a new semester..
>
> Dave
>
> Matt Nash wrote:
>> 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