Apache and ubuntu

andy baxter andy at earthsong.free-online.co.uk
Tue Jan 15 18:16:29 UTC 2008


andy baxter wrote:
> Mike Dugger wrote:
>   
>> At 05:43 PM 1/14/2008 -0500, Schiz0 wrote:
>>   
>>     
>>> On Jan 14, 2008 5:33 PM, Mike Dugger <manifold at golfront.org> wrote:
>>>     
>>>       
>>>> Hello,
>>>>
>>>> My system consists of ubuntu 7.10, Apache 2.2.4 and PHP 5.2.1
>>>>
>>>> I have installed Apache, PHP and MySql for my education/entertainment in
>>>> learning a bit about web design. The setup was working fine until I
>>>> upgraded from 7.04 to 7.10. Now php functions within html will not run,
>>>> while .php scripts run fine.
>>>>       
>>>>         
>>> If the php tags embedded into HTML aren't proper (Like "<?php" and
>>> "?>"), they you should enable the "short_open_tag" option in your
>>> php.ini file.
>>>
>>> As for starting/stopping apache, use the script "/etc/init.d/apache2"
>>>     
>>>       
>> I'm not sure what you mean here. When testing my setup I simply inserted
>> a function: <? phpinfo(); ?>  within an html file. The regular html is rendered
>> properly, but the function isn't being processed. Does that indicate that I
>> should enable "short_open_tag" in php.ini?
>>
>> Sorry to be so clueless, but I just assumed (I know) that with php running in
>> conjuction with apache that the function would simply be passed from apache
>> to php and then apache would serve the result. If I simply save that 
>> function in
>> a .php file and open it with a browser at "http://localhost/testphp.php" I 
>> get the
>> expected result.
>>
>> Thanks for your response in any event.
>>
>> - Mike
>>   
>>     
> You are right that when it's working <? phpcode; ?> should run the php 
> code and return the result as html. But to enable this you need to do 
> more than install both apache and php - you need to install the apache 
> module that links the two together (libapache-mod-php5), plus set up 
> some directives in your conf file to tell apache which directories to 
> treat as potential php code.
>
>   
P.S. I just re-read your initial email, and realised I missed the bit 
about how it was working OK until you upgraded. It sounds like what has 
happened is somehow your /etc/apache2/... files have been overwritten 
while upgrading and you need to regenerate these somehow - maybe try 
doing a full purge and reinstall of the relevant packages and then 
re-edit the conf files for your own setup.




More information about the ubuntu-users mailing list