Apache and ubuntu

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


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.




More information about the ubuntu-users mailing list