Can"t view php

Can"t view php

am 23.12.2007 02:34:39 von Rob S

Hi. I've got apache2 and php5 installed on a Ubuntu7.10 system. Sorry,
total nooby at apache & php.

I'm trying to set up a blog written in php which resides at
http://localhost/blog/ but when I type it into firefox, I get a window
asking me what I want to do with a php file. I choose to open in firefox
but I just get a blank page and the same question.

My apache2.conf has very little in it and httpd.conf is empty.
--

Rob
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
http://www.aspir8or.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -


PCMCIA - People Can't Memorise Computer Industry Acronyms
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Re: Can"t view php

am 23.12.2007 08:56:45 von unknown

Post removed (X-No-Archive: yes)

Re: Can"t view php

am 23.12.2007 19:47:28 von Rob S

Davide Bianchi wrote:
> On 2007-12-23, Rob S wrote:
>> I'm trying to set up a blog written in php which resides at
>> http://localhost/blog/ but when I type it into firefox, I get a window
>> asking me what I want to do with a php file.
>
> You have to configure your apache to _run_ php files, read the
> documentation on php's web site on how to install it.
>
> Davide
>
Heh. Thanks. Thought loading apache then php via synaptic would set it
up properly. Anyway, removed both then followed the instructions on
php.net and just my luck, I got an error "You may have found a bug in
php. Press enter to send a report now..."

So I still can't run php in browser. I guess I'll just have to wait
until someone looks at the bug report and gets back to me. Or I could go
ahead with my plan to build a new box and turn this one into a dedicated
web server. Once I've got my new box built, I'll replace the hd in this
one with a 20Gb I've got lying around, do a clean install of Ubuntu
server edition and see if that will work.

Cheers
--

Rob
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
http://www.aspir8or.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -



- - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Re: Can"t view php

am 30.12.2007 14:57:34 von Andy Ruddock

Rob S wrote:
> Davide Bianchi wrote:
>> On 2007-12-23, Rob S wrote:
>>> I'm trying to set up a blog written in php which resides at
>>> http://localhost/blog/ but when I type it into firefox, I get a
>>> window asking me what I want to do with a php file.
>>
>> You have to configure your apache to _run_ php files, read the
>> documentation on php's web site on how to install it.
>>
>> Davide
>>
> Heh. Thanks. Thought loading apache then php via synaptic would set it
> up properly. Anyway, removed both then followed the instructions on
> php.net and just my luck, I got an error "You may have found a bug in
> php. Press enter to send a report now..."
>
> So I still can't run php in browser. I guess I'll just have to wait
> until someone looks at the bug report and gets back to me. Or I could go
> ahead with my plan to build a new box and turn this one into a dedicated
> web server. Once I've got my new box built, I'll replace the hd in this
> one with a 20Gb I've got lying around, do a clean install of Ubuntu
> server edition and see if that will work.
>
> Cheers

Try re-installing both apache and php using apt-get or synaptic.
Also install libapache2-mod-php5 - assuming you're installing apache2
and php5.
You then need to make sure that apache will run the php files instead of
sending the contents back as a text file.
The directory /etc/apache2/mods-available contains all the modules that
have been installed for use with apache, and the directory
/etc/apache2/mods-enabled contains symlinks to the modules in
mods-available that will actually be loaded - this is a neat way of
enabling/disabling modules without having to uninstall/reinstall them.

For php you should have the files php5.conf and php5.load in
/etc/mods-available, so you need to create symbolic links to these in
mods-enabled.
If you do this at the command-line:

#cd /etc/apache2/mods-enabled
#sudo ln -s ../mods-available/php5.conf ./php5.conf
#sudo ln -s ../mods-available/php5.load ./php5.load


Then reload apache
#sudo /etc/init.d/apache2 reload

There's also the tools a2enmod and a2dismod which do this for you.

To enable php5 :
#sudo a2enmod php5

To disable php5 :
#sudo a2enmod php5

--
Andy Ruddock
------------
andy_DOT_ruddock_AT_gmail_DOT_com (GPG Key ID 0x74F41E8F)

Re: Can"t view php

am 30.12.2007 20:45:30 von Rob S

Andy Ruddock wrote:
> Rob S wrote:
>> Davide Bianchi wrote:
>>> On 2007-12-23, Rob S wrote:
>>>> I'm trying to set up a blog written in php which resides at
>>>> http://localhost/blog/ but when I type it into firefox, I get a
>>>> window asking me what I want to do with a php file.
>>> You have to configure your apache to _run_ php files, read the
>>> documentation on php's web site on how to install it.
>>>
>>> Davide
>>>
>> Heh. Thanks. Thought loading apache then php via synaptic would set it
>> up properly. Anyway, removed both then followed the instructions on
>> php.net and just my luck, I got an error "You may have found a bug in
>> php. Press enter to send a report now..."
>>
>> So I still can't run php in browser. I guess I'll just have to wait
>> until someone looks at the bug report and gets back to me. Or I could go
>> ahead with my plan to build a new box and turn this one into a dedicated
>> web server. Once I've got my new box built, I'll replace the hd in this
>> one with a 20Gb I've got lying around, do a clean install of Ubuntu
>> server edition and see if that will work.
>>
>> Cheers
>
> Try re-installing both apache and php using apt-get or synaptic.
> Also install libapache2-mod-php5 - assuming you're installing apache2
> and php5.
> You then need to make sure that apache will run the php files instead of
> sending the contents back as a text file.
> The directory /etc/apache2/mods-available contains all the modules that
> have been installed for use with apache, and the directory
> /etc/apache2/mods-enabled contains symlinks to the modules in
> mods-available that will actually be loaded - this is a neat way of
> enabling/disabling modules without having to uninstall/reinstall them.
>
> For php you should have the files php5.conf and php5.load in
> /etc/mods-available, so you need to create symbolic links to these in
> mods-enabled.
> If you do this at the command-line:
>
> #cd /etc/apache2/mods-enabled
> #sudo ln -s ../mods-available/php5.conf ./php5.conf
> #sudo ln -s ../mods-available/php5.load ./php5.load
>
>
> Then reload apache
> #sudo /etc/init.d/apache2 reload
>
> There's also the tools a2enmod and a2dismod which do this for you.
>
> To enable php5 :
> #sudo a2enmod php5
>
> To disable php5 :
> #sudo a2enmod php5
>

Thanks for that. I'll be tackling it again on this box soon. I'm waiting
on some parts to arrive to build myself a new pc, then I'll format and
clean install Ubuntu server edition on this one. In the meantime I've
loaded up an old Celery 433 with DSL, apache 1.3 and php4 and that's
running fine at the moment. When I've built my new box I'll turn that
one into a firewall/router.

Cheers
--

Rob
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
http://www.aspir8or.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -


Why geeks like computers: unzip, strip, touch, finger, grep, mount,
fsck, more, yes,fsck,fsck,fsck,umount, sleep.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -