Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I try to install phpmyadmin to work with nginx in my archilnux box but I seem have some problem. The steps below is exactly what I've done :

sudo pacman -S phpmyadmin

Then I create a symbolic link use exactly like the wiki:

sudo ln -s /usr/share/webapps/phpMyAdmin /srv/http/<domain>/public_html/phpmyadmin

curl return :

curl -I http://localhost/phpmyadmin
HTTP/1.1 301 Moved Permanently
Server: nginx/1.0.5
Date: Tue, 16 Aug 2011 16:57:54 GMT
Content-Type: text/html
Content-Length: 184
Location: http://localhost/phpmyadmin/
Connection: keep-alive

What I receive when I try to access through chromium :

Server error
The website encountered an error while retrieving http://localhost/phpmyadmin/. It may be down for maintenance or configured incorrectly.
Here are some suggestions:
Reload this webpage later.
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.

Error log :

2011/08/17 02:42:48 [error] 31015#0: *1 FastCGI sent in stderr: "PHP Warning:  require_once(): open_basedir restriction in effect. File(/usr/share/webapps/phpMyAdmin/libraries/common.inc.php) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/) in /usr/share/webapps/phpMyAdmin/index.php on line 33
PHP Warning:  require_once(/usr/share/webapps/phpMyAdmin/libraries/common.inc.php): failed to open stream: Operation not permitted in /usr/share/webapps/phpMyAdmin/index.php on line 33
PHP Fatal error:  require_once(): Failed opening required './libraries/common.inc.php' (include_path='.:/usr/share/pear') in /usr/share/webapps/phpMyAdmin/index.php on line 33" while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /phpmyadmin/ HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "localhost"

I hope someone can help me about this problem :)

This is resolved by : add /usr/share/webapps to open_basedir in php.ini :)

share|improve this question
1  
With what problem? What happens when you go to localhost/phpmyadmin in a browser? That redirect adds a / which is probably valid. –  EightBitTony Aug 16 '11 at 18:35
    
I just update my post above :) –  nXqd Aug 16 '11 at 18:40
    
Okay, so next step, post the error log from nginx. –  EightBitTony Aug 16 '11 at 19:04
    
edited and add log –  nXqd Aug 16 '11 at 19:19
add comment

1 Answer

up vote 1 down vote accepted

So I think it's pretty clear,

2011/08/17 02:42:48 [error] 31015#0: *1 FastCGI sent in stderr: "PHP Warning: require_once(): open_basedir restriction in effect. File(/usr/share/webapps/phpMyAdmin/libraries/common.inc.php) is not within the allowed path(s): (/srv/http/:/home/:/tmp/:/usr/share/pear/) in /usr/share/webapps/phpMyAdmin/index.php on line 33

As per Martin F's comment - check your php-fpm or php.ini settings to make sure it can execute stuff in that path.

share|improve this answer
    
Thanks for helping me clarify the problem. I hope I can resolve this one, I will update. –  nXqd Aug 16 '11 at 20:14
2  
It's not in the nginx config. Nginx neither embeds nor configures PHP, it simply sends requests to it via fastcgi. You need to configure this in either php-fpm or in your php.ini. –  Martin Fjordvald Aug 17 '11 at 4:33
    
Thanks @Martin, updated. –  EightBitTony Aug 17 '11 at 6:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.