一、configure 报错

1、错误类型:

Configure: error: Please reinstall the libcurl distribution-easy.h should be in <curl-dir>/include/curl/

解决方法:

sudo apt-get install libcurl4-gnutls-dev libcurl4-openssl-dev

2、错误类型:

configure: error: sasl.h not found!

解决方法:

sudo apt-get install libsasl2-dev

3、错误类型:

Configure: error: Please reinstall the ncurses distribution

解决方法:

sudo apt-get install libncurses5-dev

4、错误类型:

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

解决方法:

sudo apt-get install libxml2-dev

5、错误类型:

configure: error: Cannot find OpenSSL’s <evp.h>

解决方法:

sudo apt-get install openssl

6、错误类型:

Configure: error: Please reinstall the BZip2 distribution

解决方法:

sudo apt-get install bzip2

7、错误类型:编译时缺少库

configure:error:libXpm.(a|so)not found

解决方法:

sudo apt-get install libXpm-dev

8、错误类型:

Configure: error: libjpeg.(also) not found.

Configure: error: libpng.(also) not found.

(这2个报错在5.3之后的版本中应该不会有了,取消掉了这个东西)

解决方法:

sudo apt-get install libjpeg-dev libpng12-dev

9、错误类型:

Configure: error: Cannot find MySQL header files under /usr.Note that the MySQL client library is not bundled anymore!

解决方法(如果是按我的LNMP的顺序这个错也是不会发生的,因为此时数据库已经装好了):

sudo apt-get install libmysql++-dev

10、错误类型:编译时缺少gmp.h文件

configure: error: Unable to locate gmp.h

解决方法:

sudo apt-get install libgmp-dev libgmp3-dev

11、错误类型:

Configure: error: Cannot find pspell

解决方法:sudo apt-get install libpspell-dev

12、错误类型:

configure: error: mcrypt.h not found. Please reinstall libmcrypt.

解决方法:

sudo apt-get install libmcrypt-dev mcrypt

13、错误类型:

Configure: error: snmp.h not found. Check your SNMP installation.

解决方法:

sudo apt-get install libsnmp-dev

14、configure:error:Cannot find ldap.h

网上普遍的方法是安装openldap。

解决方法:

ubuntu下ldap的包名是libldap-2.4-2、ldap-utils、libldap2-dev,安装即可

15、错误类型:

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

解决方法:

sudo apt-get install libxslt1-dev

16、错误类型:

configure: error: Could not find libevent >=1.4.11 in /usr/local/php

解决方法:

安装libevent-1.4.11以上版本至/usr/local
tar xzvf libevent-1.4.14-stable.tar.gz
cd libevent-1.4.14-stable
./configure --prefix=/usr/local
make&&make install
在编译./configure时添加--with-libevent-dir=/usr/local即可

17、错误类型:

configure: error: Could not find pcre.h in /usr

解决方法:

sudo apt-get install libpcre3-dev

18、错误类型:

configure: error: DBA: Could not find necessary header file(s).checking for db4 major version... configure: error: Header contains different version

解决方法:

sudo apt-get install libdb4.8-dev

19、错误类型:

configure: error: freetype.h not found.

解决方法:

sudo apt-get install libfreetype6-dev

20、错误类型:

configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path

解决方法:

sudo apt-get install postgresql-server-dev-9.1

21、错误类型:

configure: error: Your t1lib distribution is not installed correctly. Please reinstall it.

解决方法:sudo apt-get install libt1-dev

22、错误类型:

configure: error: Unable to find gd.h anywhere under /usr

解决方法:

sudo apt-get install libgd2-xpm-dev

23、错误类型:

configure: error: ODBC header file '/usr/include/sqlext.h' not found!

解决方法:

sudo apt-get install unixodbc-dev

24、错误类型:

configure: error: Directory /usr is not a FreeTDS installation directory

解决方法:

sudo apt-get install freetds-dev

25、错误类型:

configure: error: Cannot find libtidy

解决方法:

sudo apt-get install libtidy-dev

26、错误类型:

configure: error: You've configured extension pdo_sqlite to build statically, but it depends on extension pdo, which you've configured to build shared. You either need to build pdo_sqlite shared or build pdo statically for the build to be successful.

解决方法:

Add following switches to your ./configure options:
--with-pdo-sqlite=shared
--with-sqlite=shared

27、报错类型:

configure: error: Cannot find OpenSSL's libraries

解决方法:

Add following switch to your ./configure options (optionally updating the path to reflect your system):
--with-libdir=/lib/x86_64-linux-gnu

从上面这么多错误可以看出大多数是由于库的安装不完整导致的,并且根据提示就能知道安装哪些包。

二、make 报错

1、报错类型:

error while loading shared libraies: libmysqlclient.so.20: cannot open shared object file: No such file or directory

解决方法:

shell> find / -name "libmysqlclient.so.20"
/usr/local/mysql/lib/libmysqlclient.so.20
/usr/local/src/mysql-5.7.9/libmysql/CMakeFiles/CMakeRelink.dir/libmysqlclient.so.20
/usr/local/src/mysql-5.7.9/libmysql/libmysqlclient.so.20
shell> echo "/usr/local/lib" >>/etc/ld.so.conf
shell> echo "/usr/local/mysql/lib" >>/etc/ld.so.conf
shell> sudo ldconfig

或者:

ln -s /usr/local/mysql/lib/libmysqlclient.so.20 /usr/lib64

2、报错类型:

chmod: 无法访问"ext/phar/phar.phar": 没有那个文件或目录

解决方法:

mkdir -p ext/phar/phar.phar

3、报错类型:

usr/bin/ld: ext/ldap/.libs/ldap.o: undefined reference to symbol 'ber_strdup@@OPENLDAP_2.4_2'//usr/lib/x86_64-linux-gnu/liblber-2.4.so.2: error adding symbols: DSO missing from command line

解决方法:

遇到这种类似的情况,说明「./configure 」沒抓好一些环境变数值。 在PHP源码目录下 vi Makefile 找到 EXTRA_LIBS 行,在行末添加 ‘ -llber ‘ 保存退出再次make即可。

cd /usr/local/src/php/php-5.6.15
vim Makefile
找EXTRA_LIBS行,在末尾添加--llber

4、报错类型:

cc1: out of memory allocating 2036 bytes after a total of 81846272 bytes

/usr/bin/ld: cannot find -lltdl

collect2: ld returned 1 exit status

解决方法:

sudo apt-get install libltdl-dev

三、启动服务器 报错

1、报错类型:

ERROR: [pool www] cannot get gid for group 'nobody'

解决方法:

groupadd nobody

2、报错类型:

connect() to unix:/var/run/php-fpm/php-fpm.sock failed (13: Permission denied) while connecting to upstream

解决方法(owner和group根据运行者来写):

sudo vim /usr/local/php/etc/php-fpm.conf
listen.owner = www
listen.group = www
listen.mode = 0660

ubuntu安装php常见错误集锦的更多相关文章

  1. (转)Hadoop之常见错误集锦

     Hadoop之常见错误集锦            下文中没有特殊说明,环境都是CentOS下Hadoop 2.2.0.1.伪分布模式下执行start-dfs.sh脚本启动HDFS时出现如下错误:   ...

  2. PHP编译安装时常见错误解决办法,php编译常见错误

    PHP编译安装时常见错误解决办法,php编译常见错误 1.configure: error: xslt-config not found. Please reinstall the libxslt & ...

  3. Elasticsearch学习之ElasticSearch 5.0.0 安装部署常见错误或问题

    ElasticSearch 5.0.0 安装部署常见错误或问题 问题一: [--06T16::,][WARN ][o.e.b.JNANatives ] unable to install syscal ...

  4. ubuntu 16.04常见错误--Could not get lock /var/lib/dpkg/lock解决

    我的博客 ubuntu常见错误--Could not get lock /var/lib/dpkg/lock解决 通过终端安装程序sudo apt-get install xxx时出错: E: Cou ...

  5. Python:常见错误集锦(持续更新ing)

    初学Python,很容易与各种错误不断的遭遇.通过集锦,可以快速的找到错误的原因和解决方法. 1.IndentationError:expected an indented block 说明此处需要缩 ...

  6. python的多版本安装以及常见错误(长期更新)

    (此文长期更新)Python安装常见错误汇总 注:本教程以python3.6为基准 既然是总结安装过程中遇到的错误,就顺便记录一下我的安装过程好了. 先来列举一下安装python3.6过程中可能需要的 ...

  7. 【转】ubuntu源码编译安装php常见错误解决办法

    ./configure -prefix=/usr/local/php -with-config-file-path=/etc -with-mysql=mysqlnd -with-mysqli=mysq ...

  8. Ubuntu下postgresql安装及常见错误处理

    依赖工具库 注意: 默认用户名是postgres 以下命令是Ubuntu操作系统中的命令 make GCC Zlib 安装命令:sudo apt-get install zlib1g-dev 注意有些 ...

  9. mysql编译安装后各种常见错误集锦

    1.ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', sys ...

随机推荐

  1. JPA事务总结

    http://www.soso.io/article/65405.html 事务管理是JPA中另一项重要的内容,了解了JPA中的事务管理,能够进一步掌握JPA的使用.事务管理是对一系列操作的管理,它最 ...

  2. elk系列2之multiline模块的使用

    preface 上回说道了elk的安装以及kibana的简单搜索语法,还有logstash的input,output的语法,但是我们在使用中发现了一个问题,我们知道,elk是每一行为一个事件,像Jav ...

  3. C++ STL中vector的内存机制和性能分析

    vecotr是动态数组,顾名思义他可以动态的增加自己的长度. 内存机制: 但是怎样的增加自己的长度? vector有两个函数一个是capacity()返回内存空间即缓冲区的大小,另一个是size()返 ...

  4. 通过System.getProperties()获取系统参数

    Properties props=System.getProperties(); //系统属性    System.out.println("Java的运行环境版本:"+props ...

  5. WPF:父窗口与子窗口的层次关系

    关于子窗体的层级关系总结一下哈,希望能对大家有些帮助 假设有这样两个窗体:RootWindow,SubWindow,在RootWindow中引发某事件而显示SubWindow 1,如果弹出窗体(比如S ...

  6. linux配置IP的方法

    Linux系统下如何设置IP地址?我们可以通过命令设定IP的方法,不过此方法的前提条件是用户需root权限.在Linux系统的 /etc/sysconfig/network-script/ifcfg- ...

  7. linux常用快捷键

    linux常用快捷键:ctrl+c 强制终止当前命令ctrl+l 清屏ctrl+a 光标移动到命令行首ctrl+e 光标移动到命令行尾ctrl+u 从光标合所在的位置删除到行首ctrl+z 把命令放到 ...

  8. Java数据结构——容器总结

    4大容器——List.Set.Queue.Map List 1.ArrayList 优点:随机访问元素 缺点:插入和移除元素时较慢 2.LinkedList 优点:插入和删除元素 缺点:随机访问方面相 ...

  9. Java数据结构——迭代器

  10. Codeforces Problem 708A Letters Cyclic Shift

     题目链接: http://codeforces.com/problemset/problem/708/A 题目大意: 从字符串s中挑选出一个子串(非空),将该子串中的每个字母均替换成前一个字母,如' ...