Page 1 of 1

index.php downloading. not opening

Posted: 01 Feb 2009, 05:50
by netpage
Hi,

I assume that this is related to the work I have done to get my Bubba 1 talking to my NAS http://forum.excito.net/viewtopic.php?t=1524.

Now when I try to open the web admin page I get the download dialog box. I have looked at some of the solutions on this site but not sure what I have done and what I can do to solve it.

Any ideas?

Thanks

Posted: 02 Feb 2009, 03:17
by Eek
check if these exist

ls -l /etc/apache2/mods-enabled/php*

Posted: 02 Feb 2009, 04:56
by netpage
Hi Eek,

I do not have any php* files or folders in the /etc/apache2/mods-enabled folder.

Here is the folder I do have

Code: Select all

bubba:/etc/apache2/mods-enabled# ls
alias.load	      authz_host.load  env.load		 status.load
auth_basic.load       authz_user.load  mime.load	 userdir.conf
auth_pam.load	      autoindex.load   negotiation.load  userdir.load
authn_file.load       cgi.load	       setenvif.load
authz_default.load    dir.conf	       ssl.conf
authz_groupfile.load  dir.load	       ssl.load

Posted: 02 Feb 2009, 06:10
by Eek
enable php
it should be already installed

ls -l /etc/apache2/mod-available/php*

Posted: 03 Feb 2009, 10:58
by Ubi
That should be: ls -l /etc/apache2/mods-available/php*
mind the extra S

Posted: 17 Feb 2009, 02:12
by netpage
Can anyone please advise how to enable PHP. I have tried typing the following when logged in as root but it just comes up with

Code: Select all

bubba:/# php enable
bash: php: command not found
bubba:/# enable php
bash: enable: php: not a shell builtin
but just get errors.

I have also searched the Internet but can not find an answer.

Thanks in advance

Posted: 17 Feb 2009, 15:25
by 6feet5
Try

Code: Select all

a2enmod <NAME>
Skipping the name will display all available modules and ask for a module name.

/Johan

Posted: 19 Feb 2009, 20:47
by netpage
Thanks. I have run

Code: Select all

a2enmod php4
and restarted apache but I still get the download dialog box for index.php rather than viewing it.

Any other ideas what I need to do?

Thanks

Posted: 20 Feb 2009, 16:39
by 6feet5
In a previous post you wrote you had no php* files in /etc/apache2/mods-enabled. Is this still the case after running a2enmod?

/Johan

Posted: 21 Feb 2009, 08:38
by netpage
Here is the list of the files in

Code: Select all

bubba:/etc/apache2/mods-enabled# ls
alias.load	      authz_host.load  env.load		 ssl.conf
auth_basic.load       authz_user.load  mime.load	 ssl.load
auth_pam.load	      autoindex.load   negotiation.load  status.load
authn_file.load       cgi.load	       php4.conf	 userdir.conf
authz_default.load    dir.conf	       php4.load	 userdir.load
authz_groupfile.load  dir.load	       setenvif.load
So it looks like I have a couple. Does this help?

Thanks

Posted: 21 Feb 2009, 17:31
by 6feet5
Hmm, looks like php is enabled, as far as I can tell. This is beginning to look really weird.

What is the content of the php files in /etc/apache2/mods-enabled? Is there an AddType for .php file in any of them? Have you tried a simple test script in you public_html folder?
Log on to bubba as your ordinary user and do the following (ignore the mkdir line if you already have a public_html folder in your home folder on bubba):

Code: Select all

mkdir /home/USERNAME/public_html
chmod ugo+rx /home/USERNAME/public_html
cat >/home/USERNAME/public_html/phpinfo.php
<?php phpinfo(); ?>
<CTRL-D>
Replace USERNAME with your user name, and <CTRL-D> by actually pressing Ctrl-D.
Restart Apache by typing (you need to be root for this)

Code: Select all

/etc/init.d/apache2 restart
(I'm not sure if this is necessary, but do it anyway)

Now try accessing this page with your browser by using address:

Code: Select all

http://bubba/~USERNAME/phpinfo.php
(once again replacing USERNAME with your users name, and bubba with whatever host name you're using)

What is the result?

/Johan

Posted: 23 Feb 2009, 09:27
by netpage
in the php4.conf I have

Code: Select all

IfModule mod_php4.c>
  AddType application/x-httpd-php .php .phtml .php3
  AddType application/x-httpd-php-source .phps
</IfModule>
in the php4.load I have

Code: Select all

LoadModule php4_module /usr/lib/apache2/modules/libphp4.so
I then tried to follow the other parts of your post but could not manage all of it. I ran it all as 'su' then tried as 'username' still got some errors.

However when I just tried to log on it worked. Not sure why, so I suppose this is fixed :). Thanks.