Here is How to Setup a XCache Admin Page on Nginx-PHP5-FPM on Ubuntu Instance Running on HP Cloud. It Gives a Clear Graphical Idea of Caching. We have guide on setup of WordPress with XCache. We are taking that, it is a Nginx PHP5-FPM setup, not Nginx HHVM setup with PHP5-FPM fallback. It is very difficult to make XCache working with HHVM. If you are new to HP Cloud, You can read guides on how to install Nginx PHP5-FPM to run WordPress.
Steps to Create a XCache Admin Page on Nginx-PHP5-FPM (Ubuntu, HP Cloud)
We are taking it granted that, you have XCache installed on your instance. You can check whether XCache is installed or not by running this command :
---
1 | php –v |
You can check which php.ini
is working by running this command :
1 | php –i | grep php.ini |
You should follow our previous guides to have a uniform setup. It is becomes difficult for a new user to follow hundreds of guides. If you cd
to /usr/share/xcache/
, you’ll see a directory named htdocs
. Within that htdocs
you’ll see these files :
1 2 | cacher config.default.php coverager index.php common config.example.php diagnosis |
You should check the files if you need to modify. Normally, Nginx has the public directory root at /usr/share/nginx/html
, but on HP Cloud, it can be /var/www/html
. That htdocs
should be symlinked at public directory root like at /usr/share/nginx/html
.
The thing does not work mainly for wrong smymlink. It should be like :
1 2 3 | cd /usr/share/nginx/html ln –s /usr/share/xcache/htdocs xcache # ln –s </path/to/xcache> </path/to/public/dir> |
Restart once :
1 | service php5–fpm restart && service nginx restart |
If you are getting error with php5-fpm restart, you should use my git to fix the php5-fpm restart issue.
Now if you visit the IP based location via browser :
1 | http://15.01.02.123/xcache |
You will get the user login page. Password is non-MD5 password. After login, you can view the option screen, like it is diagnostic page :
This can happen, if you use HHVM with PHP5-FPM. In that case, you have process PHP files via PHP5-FPM, you need this thing :
(HHVM plus PHP5-FPM settings, not for regular PHP5-FPM)
1 2 3 4 5 6 | location ~ .php$ { try_files $uri /index.php; include fastcgi_params; fastcgi_pass unix:/var/run/php5–fpm.sock; #fastcgi_pass 127.0.0.1:9000; } |
fastcgi_pass 127.0.0.1:9000
is for HHVM and fastcgi_pass unix:/var/run/php5-fpm.sock
is for PHP5-FPM. Your other location settings will remain the same. It is difficult to use this settings as it create issue with subdirectories. You can try location modifier
of nginx. That is we said, it is very difficult to make XCache working with HHVM.
You can try this :
1 2 3 4 5 6 7 | location /xcache/ { #alias /usr/share/xcache/; try_files $uri /index.php; include fastcgi_params; fastcgi_pass unix:/var/run/php5–fpm.sock; #fastcgi_pass 127.0.0.1:9000; } |
and restart the services :
1 2 3 | nginx –t && service php5–fpm restart # edit if nginx –t fails service hhvm restart && service nginx restart |
You’ll add it where the location directive for /doc/
is written. /
means /usr/share/
. Basically the compilation looks for .ini
at PHP5’s location. HHVM is not hugely great. Tweaking PHP5-FPM can give far better result with good setup. Most importantly, PHP5-FPM has lot of docs. HHVM for WordPress is still risks. It is not easy to switch back. You can edit the CLI of php.ini
to check your luck in making XCache working. But that web interface will not work.