phpmyadmin not showing up at all

Hello all,

On a new installation on ubuntu 9.10, I installed apache, php and mysql. I then wrote the scripts for the fcgi wrapper and switched php tp run factcgi. Then I installeded phpmyadmin using:

apt-get install phpmyadmin

which installed successfully.

Now everytime I go to mydomain.com/phpmyadmin, the following download dialog box shows up...

I have tried reinstalling after using
aptitude purge phpmyadmin and the same thing happens.
phpmydialog.png
LVL 3
dgwareAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
TobiasHolmConnect With a Mentor Commented:
This looks exactly as your problem: http://www.honeytechblog.com/how-to-fix-applicationx-httpd-php-trouble-in-getting-php-to-parse/

   1. Open your .htaccess file and take its backup
   2. Delete the old .htaccess file
   3. Create a new .htaccess file with CHMOD = 777 and upload the new file in ascii mode.
   4. Add the following handler in the blank .htaccess

      AddType application/x-httpd-php .php .htm .html
      AddHandler x-httpd-php .php .htm .html

Alternative Way: You cal also try to add following code in the blank .htaccess

AddType application/x-httpd-php php html

Regards, Tobias
0
 
TobiasHolmCommented:
Hi!

This looks like a browser problem that doesn't understand what to do with "application/x-httpd-php" type pages.

Are you using Firefox?

Regards, Tobias
0
 
themrrobertCommented:
You have to edit your httpd.conf (or the .conf file of your active site) and add the following directive:

AddHandler php5-script .php

AddHandler php-script .php  

(Try both)

This can also usually be added via an  .htaccess file.

Create a .htaccess file and add the lines above to it.

------------
The problem is apache doesn't know what a .php file is and is trying to send it directly to the browser without executing it. The lines above tell apache that a .php file is a php-script (or php5-script) and it will execute it and tell the browser that it is a text/html file instead.

0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
themrrobertCommented:
I am an absolute genius with computers. I am the best, and I know how computers think. Follow up with me with any questions.
0
 
TobiasHolmCommented:
Possible solution: reconfigure php5.

cd /usr/ports/lang/php5 && make configure ā€”ā€“ make sure that the mod_php is checked

Google for "mod_php install debian" if you have Debian to get instructions how to do this.

Regards, Tobias
0
 
themrrobertCommented:
I never look down on others, that's why I'm here. To help others and gain more knowledge in the process. I have no doubt that I can solve this problem, and the answer I gave you will fix it or put you on the right track.

But I'm just as eager to walk you through each step.

As you know, each flavor of linux handles it's config files for apache differently, but mine is usually /etc/apache2/sites-available/default

Add the lines between the <Directory> </Directory> directives, or add them to a .htaccess file (the .htaccess file must be in the directory it is modifying.)

Feel free to call if you need more help.
0
 
dgwareAuthor Commented:
themrrobert: this is what my site configuration file looks like: Also I have tested php by opening an info.php file containing: <?php phpinfo(); ?> and it works fine, so I don't think that the webserver doesn't know what to do with .php files.

(I have changed my domain name)

<VirtualHost *:80>
  ServerName host.mydomain.com
  ServerAdmin admin@mydomain.com
  DocumentRoot /home/rackelas/public_html/

  <IfModule mod_fcgid.c>
    SuexecUserGroup rackelas rackelas
    PHP_Fix_Pathinfo_Enable 1
    <Directory /home/rackelas/public_html/>
      Options +ExecCGI
      AllowOverride All
      AddHandler fcgid-script .php
      FCGIWrapper /var/www/fcgi/rackelas/fcgi-starter .php
      Order allow,deny
      Allow from all
    </Directory>
  </IfModule>

  # ErrorLog /var/log/apache2/error.log
  # CustomLog /var/log/apache2/access.log combined
  ServerSignature Off

</VirtualHost>
0
 
themrrobertConnect With a Mentor Commented:
dgware: Have you tried running a phpinfo() file inside your phpmyadmin directory?

I see you are using fastcgi. That is likely where the issue is arising. Especially if you have fastcgi and a normal php installation simultaneously installed.

(on my system, its less /etc/apache2/mods-available/mime.conf )

Add
AddType text/html .php

to your mime list. It seems like apache is telling your browser that its the "Raw" application.

Open the file that it asks you to download. Is it processed php or is it Raw PHP?


0
 
themrrobertCommented:
I agree with Tobias, his solution should work, presuming your apache is processing files correctly.
0
 
themrrobertCommented:
Nice one Tobias ;)

I love competition.
0
 
TobiasHolmCommented:
lol! :)

themrrobert, you seems to know your Linux! And it's fun when the comments are pouring in like a rain! And it's great when someone can have their problem solved really fast! hehe!
0
 
themrrobertCommented:
Yeah, sometimes I forget that google can even find answers =p
0
 
dgwareAuthor Commented:
TobiasHolm: I do not even have a .htaccess file, so I doubt that is my problem.

themrrobert: this is the guide i used to get fastcgi installed and running. I don't think I have 2 php installations.

When I open the file, it looks like raw php.

Also, I added an info.php file in /usr/share/phpmyadmin and when I run it from the browser, the same download dialog comes up, so I looked into /etc/apache/conf.d/phpmyadmin.conf, and this is the contents:

# phpMyAdmin default Apache configuration

Alias /phpmyadmin /usr/share/phpmyadmin

<Directory /usr/share/phpmyadmin>
        Options Indexes FollowSymLinks
        DirectoryIndex index.php

        <IfModule mod_php5.c>
                AddType application/x-httpd-php .php

                php_flag magic_quotes_gpc Off
                php_flag track_vars On
                php_flag register_globals Off
                php_value include_path .
        </IfModule>

</Directory>

# Authorize for setup
<Directory /usr/share/phpmyadmin/setup>
    <IfModule mod_authn_file.c>
    AuthType Basic
    AuthName "phpMyAdmin Setup"
    AuthUserFile /etc/phpmyadmin/htpasswd.setup
    </IfModule>
    Require valid-user
</Directory>

# Disallow web access to directories that don't need it
<Directory /usr/share/phpmyadmin/libraries>
    Order Deny,Allow
    Deny from All
</Directory>
<Directory /usr/share/phpmyadmin/setup/lib>
    Order Deny,Allow
    Deny from All
</Directory>

Hope this help figure things out.
0
 
dgwareAuthor Commented:
also, tobiasholm, may I ask what search term you used to find that on google, I couldn't find anything.
0
 
TobiasHolmCommented:
Sure, I googled for "application/x-httpd-php".

Regards, Tobias
0
 
dgwareAuthor Commented:
Ok, I tried something else, here goes: I installed apache, php, and mysql on a fresh copy of ubuntu. But I did not configure fcgid this time and then installed phpmyadmin.

Now, when I go to 192.168.0.60/phpmyadmin, is works, but when i go to mydomain.com/phpmyadmin, the same download dialog comes up. This is confusing. The conf file for mydomain.com is the same as the default with just ServerName mydomain.com added.
0
 
themrrobertCommented:
Try using this Directory code to replace yours. Be sure to restart apache before testing after editing.

# /etc/init.d/apache2 restart

<Directory /usr/share/phpmyadmin>
        Options Indexes FollowSymLinks
        DirectoryIndex index.php
        Options +ExecCGI
        AllowOverride All
        <IfModule mod_php5.c>
                AddHandler fcgid-script .php
                AddType application/x-httpd-php .php
                FCGIWrapper /var/www/fcgi/rackelas/fcgi-starter .php
                php_flag magic_quotes_gpc Off
                php_flag track_vars On
                php_flag register_globals Off
                php_value include_path .
        </IfModule>

</Directory>


////// IF CODE ABOVE DOESNT WORK, TRY THIS (LONG SHOT AT THIS POINT)

<Directory /usr/share/phpmyadmin>
        Options Indexes FollowSymLinks
        DirectoryIndex index.php
        Options +ExecCGI
        AllowOverride All
        <IfModule mod_php5.c>
                AddHandler php5-script .php
                AddType application/x-httpd-php .php

                php_flag magic_quotes_gpc Off
                php_flag track_vars On
                php_flag register_globals Off
                php_value include_path .
        </IfModule>

</Directory>

Open in new window

0
 
themrrobertCommented:
DO NOT use the entire code attachment. Use one or the other, and only replace the FIRST (/phpmyadmin> ) directory lines
0
 
themrrobertCommented:
Different hostnames use different virtual servers. Cross your fingers and hope that my solution above works out this time :)
0
 
dgwareAuthor Commented:
Thanks, both of you for all your input, but the solution was fairly simple, I don't know why I didn't think of it sooner. When installing fcgi I has disabled php5 module (a2dismod php5), so I simply had to enable it again, (a2enmod php5) and it started working perfectly. I hope this can help you in the future if you encounter a similar issue.

0
 
themrrobertCommented:
lol x_x

I think you should split the points :)

I mentioned that you had fast cgi enabled and was correct about you having 2 sets of php installs. fast cgi and mod_php5.

And I would have told you at that point to enable mod_php5 if you said you disabled it!

Congrats on solving the issue!


0
 
dgwareAuthor Commented:
thanks guys
0
All Courses

From novice to tech pro — start learning today.