成都网站建设设计

将想法与焦点和您一起共享

LNMP中PHP的示例分析-创新互联

小编给大家分享一下LNMP中PHP的示例分析,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!

成都创新互联公司是一家专业提供五寨企业网站建设,专注与成都网站制作、网站建设、H5场景定制、小程序制作等业务。10年已为五寨众多企业、政府机构等服务。创新互联专业网站设计公司优惠进行中。

wget  http://cn2.php.net/distributions/php-5.4.37.tar.bz2
tar jxf php-5.4.37.tar.bz2
useradd -s /sbin/nologin php-fpm
cd php-5.4.37
./configure --prefix=/usr/local/php   --with-config-file-path=/usr/local/php/etc  --enable-fpm   --with-fpm-user=php-fpm  --with-fpm-group=php-fpm   --with-mysql=/usr/local/mysql  --with-mysql-sock=/tmp/mysql.sock  --with-libxml-dir  --with-gd   --with-jpeg-dir  --with-png-dir   --with-freetype-dir  --with-iconv-dir  --with-zlib-dir   --with-mcrypt  --enable-soap  --enable-gd-native-ttf   --enable-ftp  --enable-mbstring  --enable-exif  --disable-ipv6     --with-curl
make && make install

cp php.ini-production /usr/local/php/etc/php.ini

拷贝启动脚本:
cp /usr/local/src/php-5.4.37/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
mv /usr/local/php/etc/php-fpm.conf.default  /usr/local/php/etc/php-fpm.conf
chmod 755 /etc/init.d/php-fpm
chkconfig --add php-fpm
service php-fpm start
chkconfig php-fpm on

编译错误:

LNMP中PHP的示例分析

LNMP中PHP的示例分析

LNMP中PHP的示例分析

LNMP中PHP的示例分析

错误7

报错内容:configure: error: mcrypt.h not found. Pleasereinstall libmcrypt

centos源不能安装libmcrypt-devel,由于版权的原因没有自带mcrypt的包



有两种方法解决,一种是使用第三方源,这样还可以使用yum来安装,简单方便,坏处是第三方源多少有中不可靠的感觉。

报错内容:configure: error: mcrypt.h not found. Please reinstall libmcrypt

网上搜索了很多,包括自带的 yum install libmcrypt libmcrypt-devel,这个是没有效果的。

去SourceForget下载libmcrypt http://sourceforge.NET/projects/mcrypt/files/Libmcrypt/ ,最新版是mcrypt 2.6.7.gz。下载下来安装仍旧报错libmcrypt没有找到!

继续测试,最后安装成功,感觉是版本太高。

方法(关键点在用 2.5.7版本):

[html] view plain copy

  1. #使用wget可以通过以下路径下载

  2. wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz

  3. #解压

  4. tar -zxvf libmcrypt-2.5.7.tar.gz

  5. #进入目录

  6. cd libmcrypt-2.5.7

  7. #编译(默认安装到/usr/local/lib/)

  8. ./configure --prefix=/usr/local/libmcrypt

  9. #执行安装

  10. make && make install

解决办法一

1、安装第三方yum源

wget http://www.atomicorp.com/installers/atomic

sh ./atomic

2、使用yum命令安装

yum  install  php-mcrypt  libmcrypt  libmcrypt-devel

LNMP中PHP的示例分析

以上是“LNMP中PHP的示例分析”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注创新互联行业资讯频道!

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


新闻名称:LNMP中PHP的示例分析-创新互联
网址分享:http://chengdu.cdxwcx.cn/article/dogjoe.html