cd
tar -zxvf libmcrypt-2.5.8.tar.gz -C /usr/src/
cd /usr/src/libmcrypt-2.5.8/
./configure && make && make install
ln -s /usr/local/lib/libmcrypt.* /usr/lib/
cd
tar -zxvf mhash-0.9.9.9.tar.gz -C /usr/src/
cd /usr/src/mhash-0.9.9.9/
./configure && make && make install
ln -s /usr/local/lib/libmhash* /usr/lib/
cd
tar -zxvf mcrypt-2.6.8.tar.gz -C /usr/src/
cd /usr/src/mcrypt-2.6.8/
./configure
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
./configure
make && make install
cd
tar -zxvf php-5.5.38.tar.gz -C /usr/src/
cd /usr/src/php-5.5.38/
./configure --prefix=/usr/local/php --with-mcrypt --with-apxs2=/usr/local/httpd/bin/apxs --with-mysql --with-mysqli --with-config-file-path=/usr/local/php --enable-mbstring --enable-sockets
make && make install
cp /usr/src/php-5.5.38/php.ini-development /usr/local/php/php.ini
tar -zxvf zend-loader-php5.5-linux-x86_64_update1.tar.gz -C /usr/src/
cd /usr/src/zend-loader-php5.5-linux-x86_64/
ls
cp ZendGuardLoader.so /usr/local/php/lib/php/
vim /usr/local/php/php.ini
修改:
default_charset = "utf-8”(不修改这个会乱码)
添加:
zend_extension=/usr/local/php/lib/php/ZendGuardLoader.so #模块路径
zend_loader.enable=1 #开启模块
vim /usr/local/httpd/conf/httpd.conf
改:LoadModule php5_module modules/libphp5.so(64行)
加:AddType application/x-httpd-php .php
第259行改
<IfModule dir_module>
DirectoryIndex index.php index.html
</IfModule>
第385行
#AddType application/x-gzip .tgz
AddType application/x-httpd-php .php (添加)
vim index.php
添加:
phpinfo( );
?>
访问
firefox http://192.168.1.1/
mv index.php index.php_back
vim index.php
添加:如果分布式部署的话把localhost换成mysql主机ip,并且在mysql上对apache授权
$link=mysqli_connect('192.168.1.2','root','123.com');
if($link) echo "恭喜你,数据库连接成功啦!!";
?>
注意:MySQL端需要授权
grant all on *.* to 'root'@'192.168.1.1' identified by '123.com';
访问
[root@localhost htdocs]#firefox http://192.168.1.1/ &
[root@localhost ~]#tar -zxvf phpMyAdmin-4.7.2-all-languages.tar.gz -C /usr/src/
[root@localhost ~]#cd /usr/src/
[root@localhost ~]#cp -r phpMyAdmin-4.7.2-all-languages/ /usr/local/httpd/htdocs/phpMyAdmin(自己创建)
[root@localhost ~]#cd /usr/local/httpd/htdocs/phpMyAdmin
[root@localhost ~]#cp config.sample.inc.php config.inc.php
vim config.inc.php
修改:
$cfg[‘blowfish_secret’] = ‘a8b7c6d’;
配置文件里添加 创建用户为’root’,设置密码为’123.com’
[root@localhost ~]#firefox http://192.168.1.1/phpMyAdmin &
登录进去后就是mysql图形化界面