suPHP + phpmyadmin = 500

i am running ubuntu

phpmyadmin was working, i have since installed suPHP and now phpmyadmin does not work.

i get a 500 error and an index.php file downloads.

i am not sure where to go from here.

suPHP by default does not allow folders outside of the docroot and the owner of the phpmyadmin files is root

i have tried disabled that check for docroot, which i really do not think is safe and i tried changing the owner of the phpmyadmin files to www-data just for the heck of it an it doesn't work.

so i think i need to have phpmyadmin installed in the docroot?

7 Replies

What does your apache error log say?

this is from the suphp.log

if i dont enable going outside of the docroot, which is default, i get this

[Sun Sep 19 18:42:17 2010] [warn] File "/usr/share/phpmyadmin/index.php" is not in document root of Vhost "/home/brian/public_html"

if i enable going outside of the docroot, i get this

[Sun Sep 19 18:50:19 2010] [warn] Script "/usr/share/phpmyadmin/index.php" resolving to "/usr/share/phpmyadmin/index.php" not within configured docroot

by docroot they mean my public_html directory

this error happens for each account on the server, so it's as if it would have to be installed on each docroot which is just silly

so i got it working…

only way was to go by ip address.

my second ip address is not assigned to a site so i can go to that and it just goes the main website dir

/var/www

i copied phpmyadmin to /var/www/phpmyadmin

then it worked…

making a symlink even would not work, i had to copy the whole dir

also i needed to

chown -R www-data:www-data /var/www/phpmyadmin

so now i go to

12.34.56.78/phpmyadmin

and it works, and i guess that anyone on the server who wants to use phpmyadmin will have to go there as well

EDIT:

then to make this pretty much transparent to current users,

i added a line to their virtual host file

Redirect /phpmyadmin http://12.34.56.78/phpmyadmin

i only added this to accounts who actually use phpmyadmin, this seems like an added security benefit so that people wont just get to the phpmyadmin login page and start guessing away for most of the sites on my server.

symlinks won't work if you don't have FollowSymLinks

the symlink itself worked, i would just get an error such as:

[Sun Sep 19 18:50:19 2010] [warn] Script "/var/www/phpmyadmin/index.php" resolving to "/usr/share/phpmyadmin/index.php" not within configured docroot

Why don't you just give phpmyadmin it's own virtual host configuration with the docroot set to where it's installed. Then phpmyadmin will be in the doc root and your problems will go away.

i could, but phpmyadmin would only work for that one docroot, in the puiblic_html of that virtualhost.

meaning anyone who wanted to access it would have to go to phpmyadmin.mysite.com

by the way i am using virtualmin, not that it really matters.

it's fixed now so i am happy

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct