温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

LNMP中PHP的示例分析

发布时间:2021-10-19 10:44:22 来源:亿速云 阅读:135 作者:小新 栏目:web开发

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

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. #解压  

  5. tar -zxvf libmcrypt-2.5.7.tar.gz   

  6.    

  7. #进入目录  

  8. cd libmcrypt-2.5.7  

  9.    

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

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

  12.    

  13. #执行安装  

  14. 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的示例分析”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注亿速云行业资讯频道!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI