标签:php
yum install -y freetype freetype-devel libxml2 libxml2-devel curl-devel libjpeg libjpeg-devel libpng libpng-develhttpd与php合作
vim /usr/local/apache/conf/httpd.conf
<IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule>
AddType application/x-httpd-php .php .html
Include conf//extra/httpd-vhosts.conf
httpd -t
service httpd restart
php安装memcache扩展
yum install unzip
unzip php7.zip
cd pecl-memcache-php7/
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install
vim /usr/local/php/etc/php.ini
extension_dir = "/usr/local/php/lib/php/extensions/no-debug-zts-20160303/"
extension = "memcache.so"
php安装memcached扩展
wget https://launchpadlibrarian.net/165454254/libmemcached-1.0.18.tar.gz
tar xf libmemcached-1.0.18.tar.gz
cd libmemcached-1.0.18
./configure -prefix=/usr/local/libmemcached -with-memcached
make或make clean all LDFLAGS="-L/usr/lib64 -L/lib64"
make install
git clone https://github.com/php-memcached-dev/php-memcached
cd php-memcached/
/usr/local/php/bin/phpize
git checkout -b php7
./configure --with-php-config=/usr/local/php/bin/php-config --with-libmemcached-dir=/usr/local/libmemcached --disable-memcached-sasl
make
make install
vim /usr/local/php/etc/php.ini
extension = "memcached.so"
tar zxf mongo-1.6.16.tgz
cd mongo-1.6.16
phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install
vim /usr/local/php/etc/php.ini
extension_dir = "/usr/local/php/lib/php/extensions/no-debug-zts-20131226/"
extension = mongo.so
httpd -t
service httpd restart
<?php
// connect to mongodb
$m = new Mongoclient("mongodb://47.101.99.1:27017");
echo "Connection to database successfully<br/>";
// select a database
$db = $m->xwgl;
echo "Database xwgl selected";
标签:php
原文地址:http://blog.51cto.com/zuoshou/2119836