I have add this line to php.ini file.
extension=memcached.so
And I have got error message when I run php command.
[ec2-user@ip-172-31-1-237 ~]$ php -v
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/5.6/modules/memcached.so' - /usr/lib64/php/5.6/modules/memcached.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 5.6.17 (cli) (built: Jan 16 2016 00:21:00)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
I am deploying php project on AWS EC2(Linux AMI). I have already installed memcached on linux AMI and using this command run memcached service successfully.
sudo service memcached start
And I have checked memcached service status like this.
[ec2-user@ip-172-31-1-237 ~]$ echo stats | nc -4 localhost 11211
STAT pid 15597
STAT uptime 5807
...
END
And then I tried to install memcached extension like this.
wget http://pecl.php.net/get/memcached
tar -zxvf memcached
cd memcached-x.x.x
phpize
But I got error message as following:
[ec2-user@ip-172-31-1-237 memcached-2.2.0]$ phpize
Can't find PHP headers in /usr/include/php/5.6/php
The php-devel package is required for use of this command.
So I tried to install php-devel like this.
[ec2-user@ip-172-31-1-237 memcached-2.2.0]$ sudo yum install php-devel
Loaded plugins: priorities, update-motd, upgrade-helper
amzn-main/latest | 2.1 kB 00:00
amzn-updates/latest | 2.3 kB 00:00
Resolving Dependencies
--> Running transaction check
---> Package php-devel.x86_64 0:5.3.29-1.8.amzn1 will be installed
--> Processing Dependency: php(x86-64) = 5.3.29-1.8.amzn1 for package: php-devel-5.3.29-1.8.amzn1.x86_64
--> Processing Dependency: libgmp.so.3()(64bit) for package: php-devel-5.3.29-1.8.amzn1.x86_64
--> Running transaction check
---> Package compat-gmp4.x86_64 0:4.3.2-1.14.amzn1 will be installed
---> Package php.x86_64 0:5.3.29-1.8.amzn1 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.29-1.8.amzn1 for package: php-5.3.29-1.8.amzn1.x86_64
--> Processing Dependency: httpd-mmn = 20051115 for package: php-5.3.29-1.8.amzn1.x86_64
--> Processing Dependency: php-cli(x86-64) = 5.3.29-1.8.amzn1 for package: php-5.3.29-1.8.amzn1.x86_64
--> Running transaction check
---> Package httpd.x86_64 0:2.2.31-1.6.amzn1 will be installed
--> Processing Dependency: httpd-tools = 2.2.31-1.6.amzn1 for package: httpd-2.2.31-1.6.amzn1.x86_64
--> Processing Dependency: apr-util-ldap for package: httpd-2.2.31-1.6.amzn1.x86_64
---> Package php-cli.x86_64 0:5.3.29-1.8.amzn1 will be installed
---> Package php-common.x86_64 0:5.3.29-1.8.amzn1 will be installed
--> Running transaction check
---> Package apr-util-ldap.x86_64 0:1.4.1-4.17.amzn1 will be installed
---> Package httpd-tools.x86_64 0:2.2.31-1.6.amzn1 will be installed
--> Processing Conflict: httpd24-2.4.16-1.63.amzn1.x86_64 conflicts httpd < 2.4.16
--> Processing Conflict: httpd24-tools-2.4.16-1.63.amzn1.x86_64 conflicts httpd-tools < 2.4.16
--> Processing Conflict: php55-5.5.31-1.111.amzn1.x86_64 conflicts php < 5.5.31-1.111.amzn1
--> Processing Conflict: php55-cli-5.5.31-1.111.amzn1.x86_64 conflicts php-cli < 5.5.31-1.111.amzn1
--> Processing Conflict: php55-common-5.5.31-1.111.amzn1.x86_64 conflicts php-common < 5.5.31-1.111.amzn1
--> Processing Conflict: php56-cli-5.6.17-1.120.amzn1.x86_64 conflicts php-cli < 5.5.22-1.98
--> Processing Conflict: php56-common-5.6.17-1.120.amzn1.x86_64 conflicts php-common < 5.5.22-1.98
--> Finished Dependency Resolution
Error: php55-cli conflicts with php-cli-5.3.29-1.8.amzn1.x86_64
Error: php56-common conflicts with php-common-5.3.29-1.8.amzn1.x86_64
Error: httpd24-tools conflicts with httpd-tools-2.2.31-1.6.amzn1.x86_64
Error: php55-common conflicts with php-common-5.3.29-1.8.amzn1.x86_64
Error: httpd24 conflicts with httpd-2.2.31-1.6.amzn1.x86_64
Error: php55 conflicts with php-5.3.29-1.8.amzn1.x86_64
Error: php56-cli conflicts with php-cli-5.3.29-1.8.amzn1.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
Who can help me? Regards.