centos php 拓展(centos7安装php环境)
大家好,今天小编来为大家解答centos php 拓展这个问题,centos7安装php环境很多人还不知道,现在让我们一起来看看吧!
CentOSyumphpmcrypt扩展安装方法
使用 yum install php-mcrypt安装mcrypt扩展时会提示没有安装包
Setting up Install Process
No package php-mcrypt available.
Error: Nothing to do
mcrypt是加密扩展库,加载了它可以用他里面自带的22种加密解密算法
CentOS6默认安装的是php5.3.2
默认的 redhat repos php中是没有 mcrypt扩展的
根据红帽的官方消息()RHEL不打算添加PHP的mcrypt的支持
Joe Orton 2010-08-05 04:47:17 EDT
Thanks for the report.
We are not planning to ship mcrypt support for PHP.
解决方法:
从php官网下载新的php 5.3源码包后,解压到本地目录
进入解压目录下的 ext目录后会发现有 mcrypt,
进入 mcrypt目录
#cd/ext/mcrypt
#phpize
注意:如果报-bash:phpize not Found那么 yum install php-devel就可以使phpize进行动态编译安装扩展
#./configure-with-php-config=/usr/sbin/php/bin/php-config
#make&& make install
出现:
----------------------------------------------------------------------
Libraries have been installed in:
/var/php-5.3.10/ext/mcrypt/modules
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the `LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the `LD_RUN_PATH' environment variable
during linking
- use the `-Wl,-rpath-Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to `/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Build complete.
Don't forget to run'make test'.
Installing shared extensions:/usr/lib64/php/modules/
查看:
# php-m
...
libxml
mbstring
mcrypt
mysql
...
[Zend Modules]
已安装成功!
再次查看 phpinfo,可以看到mcrypt扩展详情。
CentOS 7 装2个版本PHP共存,网站迁移服务器
在一台高性能服务器上实现两个项目共存于不同版本的PHP环境,具体操作如下:
需求是将原本在两台服务器上分别运行的项目,一个在PHP5.6下,另一个在PHP7.4下,合并至一台高性能服务器。
首先,通过手动启用宝塔的 apache,确保Apache服务运行正常。
接着,确保Apache能够支持多版本的PHP环境,让php-V显示版本为php 7.4。
然后,配置Apache以使得ip地址能直接访问web内容,实现网站的正常访问。
利用Apache虚拟目录Alias功能,将深层的目录结构映射为一级目录,优化SEO。
进一步,实现SSL支持,为网站提供安全的连接。
为了方便管理和切换网站PHP版本,可通过命令来控制单个网站的启动与停止。
结合BT命令行大全,可以实现更多高级操作和自动化管理。
centos 7.2 系统 php7.0.12的 curl 扩展怎么开启
curl是一个广泛使用的用来上传和下载的命令行工具,当然严格来讲,它还可以有别的用途。对于测试来讲,它是Web相关测试非常实用的工具,包括debugging,使用起来非常方便。
下面直接进入主题:
1、直接进入到php源码包中找到原先安装PHP的源码包文件①;
2、直接进入/usr/package/php-7.1.10/ext/curl目录②;
cd/usr/package/php-7.1.10/ext/curl
3、通过phpize工具生成configure文件③;
/usr/local/php/bin/phpize
4、将安装的软件进行配置,检查当前的环境是否满足要安装软件的依赖关系④;
./configure--with-php-config=/usr/local/php/bin/php-config
5、编译程序并安装文件;
make&&make install
6、在php的配置文件php.ini最后一行添加extension=curl.so即可。
相关解释(带圆圈的数字编号)可参考: