I have one custom made php & mysql web application , hosted in separate server’s ,in Singapore region . one php server + one mysql db server , both working fine . because , app have read more than the write , So i want to add a one memcache server . memcached server successfully installed and cached the test data on localhost . But i want to use this on other remote web server so i have change in memcached.conf file -l 127.0.0.1 to memcached server private ip 10.x.x.x . On php server , try to connect memcached server but its always shows a HTTP ERROR 500 error page , page isn’t working error .
tried lots of googling this but not helping any thing ! Do i have to install any connector ON PHP app server to connect with memcached server on private ip .
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
hey @kamaln7 thanks for response , yes i have checked the php based web server’s error logs , that says
2016/04/29 05:01:28 [error] 4355#0: *494 FastCGI sent in stderr: "PHP message: PHP Fatal error: Class 'Memcached' not found in /var/www/test.php
.So when i install memcached on web server
apt-get install php5-memcached
, & added in php.iniextension = memcached.so
, than php web server start connected to remotely memcached server , now everything works fine ,So is this right way to connect other server ? do we have too install memcached in web server ?
Hi!
You are on the correct path. Once you’ve configured memcached to listen on the private IP address, you need to configure PHP to connect to that IP address for memcached.
Open
/etc/php5/fpm/php.ini
in your favorite text editor and update the following settings:Finally, restart php5-fpm so that the changes take effect:
If you still get a 500 error after doing that, check nginx’s error logs (which is where php5-fpm’s errors should go) and see if there are any details in there: