dgware
asked on
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
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
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.
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.
I am an absolute genius with computers. I am the best, and I know how computers think. Follow up with me with any questions.
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
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
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-availab le/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.
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-availab
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.
ASKER
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/fcg i-starter .php
Order allow,deny
Allow from all
</Directory>
</IfModule>
# ErrorLog /var/log/apache2/error.log
# CustomLog /var/log/apache2/access.lo g combined
ServerSignature Off
</VirtualHost>
(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/fcg
Order allow,deny
Allow from all
</Directory>
</IfModule>
# ErrorLog /var/log/apache2/error.log
# CustomLog /var/log/apache2/access.lo
ServerSignature Off
</VirtualHost>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I agree with Tobias, his solution should work, presuming your apache is processing files correctly.
Nice one Tobias ;)
I love competition.
I love competition.
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!
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!
Yeah, sometimes I forget that google can even find answers =p
ASKER
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/phpmyad min.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/setu p>
<IfModule mod_authn_file.c>
AuthType Basic
AuthName "phpMyAdmin Setup"
AuthUserFile /etc/phpmyadmin/htpasswd.s etup
</IfModule>
Require valid-user
</Directory>
# Disallow web access to directories that don't need it
<Directory /usr/share/phpmyadmin/libr aries>
Order Deny,Allow
Deny from All
</Directory>
<Directory /usr/share/phpmyadmin/setu p/lib>
Order Deny,Allow
Deny from All
</Directory>
Hope this help figure things out.
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/phpmyad
# 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/setu
<IfModule mod_authn_file.c>
AuthType Basic
AuthName "phpMyAdmin Setup"
AuthUserFile /etc/phpmyadmin/htpasswd.s
</IfModule>
Require valid-user
</Directory>
# Disallow web access to directories that don't need it
<Directory /usr/share/phpmyadmin/libr
Order Deny,Allow
Deny from All
</Directory>
<Directory /usr/share/phpmyadmin/setu
Order Deny,Allow
Deny from All
</Directory>
Hope this help figure things out.
ASKER
also, tobiasholm, may I ask what search term you used to find that on google, I couldn't find anything.
Sure, I googled for "application/x-httpd-php".
Regards, Tobias
Regards, Tobias
ASKER
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.
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.
Try using this Directory code to replace yours. Be sure to restart apache before testing after editing.
# /etc/init.d/apache2 restart
# /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>
DO NOT use the entire code attachment. Use one or the other, and only replace the FIRST (/phpmyadmin> ) directory lines
Different hostnames use different virtual servers. Cross your fingers and hope that my solution above works out this time :)
ASKER
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.
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!
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!
ASKER
thanks guys
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