五、整合PHP与MYSQL
在mysql服务器上创建php服务器能够访问的数据库和用户:
1 /usr/local/mysql/bin/mysql 2 -------------------------------------------- 3 CREATE DATABASE wordpress; 4 GRANT ALL ON wordpress.* TO 'wordpress'@'192.168.19.92' IDENTIFIED BY '123456'; 5 FLUSH PRIVILEGES;
六、安装wordpress
1.在/www文件夹下放入网页文件
2.访问,并按提示进行安装,配置没问题则会安装成功
七、为php安装xcache
1.解压并安装:
1 tar xf xcache-3.2.0.tar.gz 2 cd xcache-3.2.0 3 /usr/local/php/bin/phpize 4 ./configure --enable-xcache --with-php-config=/usr/local/php/bin/php-config 5 make && make install
完成后,会出现:Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
2.加载模块:
1 vim /etc/php.ini 2 ----------------------------------- 3 extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/xcache.so //找到extension配置的地方,加上此句
八、为php安装memcache
1.解压并安装:
1 tar xf memcache-2.2.7.tgz 2 cd memcache-2.2.7 3 /usr/local/php/bin/phpize 4 ./configure --with-php-config=/usr/local/php/bin/php-config --enable-memcache 5 make && make install
完成后,会出现:Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
2.加载模块:
1 vim /etc/php.ini 2 ----------------------------------- 3 extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/memcache.so //找到extension配置的地方,加上此句
3.两个加速模块都安装完毕,重启php-fpm:
1 service php-fpm restart
4.创建一个php测试页,并查看模块是否加载成功:
至此,演示完毕。如果您发现了什么问题,请及时联系我,谢谢!