Jump to content
Froxlor Forum
  • 0

Phpmyadmin + Fcgi


Klaphekje

Question

Hi,

 

I switched from syscp to froxlor a few weeks ago(clean install), with froxlor i also started using fcgi last week according to the handbook here on the site to avoid permission problems between apache and proftp.

 

Since i configured fcgi, phpmyadmin does not work anymore. When i go phpmyadmin, a download screen pops up asking if i want tot download index.php.

I tried to find the problem and found out that it does work when i enable mod_php5(a2enmod php5), but then i get permission problems again.

 

Is there a way to get phpmyadmin working with fcgi or to use the mod_php5 only for phpmyadmin?

 

Further info:

Ubuntu 10.04

Apache2, MySQL, Proftpd

Files->0644

Directories->0755

 

i hope someone is able to help :)

 

Klaphekje

Link to post
Share on other sites

12 answers to this question

Recommended Posts

both works:

 

mod_php => set permission to webserver-user (www-data or apache)

 

mod_fcgid => manually create a php-fcgi-starter (you can copy and paste already existing ones and edit the pathes), use local user you added (e.g. pma)

ATTENTION: Don't place your manually created fcgi-starters into the same directory as froxlor does, because these directories are regenerated and your manual configs will be deleted.

Link to post
Share on other sites

Thanks for the reply it is really helpfull, exept for the following part

 

I tried the mod_fcgid, because thats the one i'd like to work with, i created a vhost file, a local user and a php-fcgi-starter (edited froxlor copies),when i open it the browser it gives me an error:

Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly.

 

According to the log file phpmyadmin wont start because:

mod_fcgid: stderr: PHP Warning:  realpath(): SAFE MODE Restriction in effect.  The script whose uid is 9998 is not allowed to access /usr/share/phpmyadmin owned by uid 0 in /usr/share/phpmyadmin/libraries/Error.class.php on line 401

 

This one seems obvious, but i am unable to fix it.

This is the original phpmyadmin install also used before using mod_fcgid (installed via apt), uid 9998 is the pma user, 0 is the root user.

Can you help me in the right direction here?

 

Thanks in advance,

 

Klaphekje

 

ps

i also found this error repeatedly in my log file:

 

[error] [client xx.xx.xx.xx] PHP Notice:  Undefined index: multiserver in /var/www/froxlor/lib/navigation/30.multiserver.php on line 21, referer: http://xxx/froxlor/admin_index.php
[error] [client xx.xx.xx.xx] PHP Notice:  Undefined index: multiserver in /var/www/froxlor/lib/navigation/30.multiserver.php on line 27, referer: http://xxx/froxlor/admin_index.php

(also with other strings behind the admin_index.php?)

 

i'm also unable to fix/find this problem. any suggestions?

Link to post
Share on other sites

That is the problem :P

I allready did a

chown -R pma:pma /usr/var/phpmyadmin/

Before that the suexec.log complained the gid/uid did not match, and refused to start al all.

 

After the chown the starter did start and i could access it trough my browser.

And in the browser i got the error, could not start phpmyadmin(phpmyadmin/error.php), check your logs (or something like that).

Which came with tbe error in my previous post ;p

Link to post
Share on other sites
<VirtualHost 192.168.1.13:80>
 ServerName domain.com
 ServerAdmin admin@domain.com
 DocumentRoot "/usr/share/phpmyadmin/"
 SuexecUserGroup "pma" "pma"
 <Directory "/usr/share/phpmyadmin/">
   AddHandler fcgid-script .php
   FCGIWrapper /var/www/php-fcgi-scripts/pma/phpmyadmin.domain.com/php-fcgi-starter .php
   Options +ExecCGI
   Order allow,deny
   allow from all
 </Directory>
 ErrorLog "/var/customers/logs/phpmyadmin-error.log"
 CustomLog "/var/customers/logs/phpmyadmin-access.log" combined
</VirtualHost>

Link to post
Share on other sites

If you mean the following:

 

vhost:

<VirtualHost 192.168.1.13:80>
 ServerName xxx
 ServerAdmin xxx
 DocumentRoot "/var/www/phpmyadmin/"
 SuexecUserGroup "pma" "pma"
 <Directory "/var/www/phpmyadmin/">
   AddHandler fcgid-script .php
   FCGIWrapper /var/www/pma/phpmyadmin.domain.com/php-fcgi-starter .php
   Options +ExecCGI
   Order allow,deny
   allow from all
 </Directory>
 ErrorLog "/var/customers/logs/phpmyadmin-error.log"
 CustomLog "/var/customers/logs/phpmyadmin-access.log" combined
</VirtualHost>

 

fcgid starter:

#!/bin/sh
umask 022
PHPRC='/var/www/pma/phpmyadmin.domain.com/'
export PHPRC
PHP_FCGI_CHILDREN=0
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=250
export PHP_FCGI_MAX_REQUESTS
exec /usr/bin/php-cgi -c '/var/www/pma/phpmyadmin.domain.com/'

 

unfortunately this does not work either.

 

ps

If you do not know either, Plan B,

mod_php => set permission to webserver-user (www-data or apache)

What do you mean exactly with this?

Link to post
Share on other sites

it should work though, any new error messages, did you check the permissions again? i got exact same setup with pma

 

 

what i meant with the second is: simply run pma with mod_php instead of fcgid

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...