Centos 7 php 预编译异常解决办法搜罗

1.-bash: locate: command not found

安装
$ sudo yum install mlocate
测试
$ locate hello
locate: can not stat () `/var/lib/mlocate/mlocate.db': 没有那个文件或目录
初始化
$ sudo updatedb
过几分钟再执行就可以执行locate找到相应的文件了
http://blog.csdn.net/feifeilyj/article/details/52238209

2.# build php5.3.8 on ubuntu , get error: configure: error: Unable to locate gmp.h

yum install gmp-devel

3.) Configure: error: xml2-config not found. Please check your libxml2 installation.

#yum install libxml2 libxml2-devel (For Redhat & Fedora)
# aptitude install libxml2-dev      (For ubuntu)
  1. Checking for pkg-config… /usr/bin/pkg-config
    configure: error: Cannot find OpenSSL’s
#yum install openssl openssl-devel
  1. Configure: error: Please reinstall the BZip2 distribution
# yum install bzip2 bzip2-devel
  1. Configure: error: Please reinstall the libcurl distribution -
    easy.h should be in /include/curl/
# yum install curl curl-devel   (For Redhat & Fedora)
# install libcurl4-gnutls-dev    (For Ubuntu)
  1. Configure: error: libjpeg.(also) not found.
# yum install libjpeg libjpeg-devel
  1. Configure: error: libpng.(also) not found.
# yum install libpng libpng-devel
  1. Configure: error: freetype.h not found.
#yum install freetype-devel
  1. Configure: error: Unable to locate gmp.h
# yum install gmp-devel
  1. Configure: error: Cannot find MySQL header files under /usr.
    Note that the MySQL client library is not bundled anymore!
# yum install mysql-devel            (For Redhat & Fedora)
# apt-get install libmysql++-dev      (For Ubuntu)
  1. Configure: error: Please reinstall the ncurses distribution
# yum install ncurses ncurses-devel
  1. Checking for unixODBC support… configure: error: ODBC header file ‘/usr/include/sqlext.h’ not found!
# yum install unixODBC-devel
  1. Configure: error: Cannot find pspell
# yum install pspell-devel
  1. configure: error: mcrypt.h not found. Please reinstall libmcrypt.
# yum install libmcrypt libmcrypt-devel    (For Redhat & Fedora)
# apt-get install libmcrypt-dev
  1. Configure: error: snmp.h not found. Check your SNMP installation.
# yum install net-snmp net-snmp-devel

15.configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution

yum -y install libxslt libxslt-devel

16.xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution

yum -y install libxslt libxslt-devel

17.virtual memory exhausted: Cannot allocate memory

问题原因:由于物理内存本身很小,且阿里云服务器并没有分配swap空间,当物理内存不够用时,物理内存中暂时不用的内容没地方转存。

解决方法:手动分配一个swap空间
dd if=/dev/zero of=/swap bs=1024 count=1M    #创建一个大小为1G的文件/swap
mkswap /swap   #将/swap作为swap空间
swapon /swap   #enable /swap file  for paging and swapping
echo "/swap swap swap sw 0 0" >> /etc/fstab    #Enable swap on boot, 开机后自动生效

18.# linux 启动php-fpm please specify user and group other than root

提示很明确了,为了安全考虑,不要使用root账户来运行php-fpm,否则别人随便一个shell,你的系统不就直接崩溃了吗?
首先新建个www用户和www用户组,然后将配置这里更改为
user=www
group=www
https://segmentfault.com/q/1010000007052707

19.# LINUX创建www的用户组和用户,并且不允许登录权限:

# id www
id: www:无此用户
# groupadd www
# useradd -g www -s /sbin/nologin www
# id www
uid=501(www) gid=501(www) 组=501(www)
https://www.cnblogs.com/cnbing/p/6957239.html

http://blog.sina.com.cn/s/blog_7e4c8f2b0100v39j.html

你可能感兴趣的:(Centos 7 php 预编译异常解决办法搜罗)