lnmp编译错误大汇总

CentOS6.4

错误一
-bash: cmake: command not found
export PATH=$PATH:/usr/local/cmake/bin

错误二:其实是一个警告
configure: WARNING: unrecognized options: –enable-fpm–with-fpm-user, –enable-gd-native-ttf, –with-mysql
思路:查看格式是否错误、
解决:mysql:./configure –help查看后没有此种用法,删除(pdo后接DIP为初始化指定的basedir)

错误三
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/usr/local/mysql/mysql.sock’ (2)
法一:修改/etc/my.cnf 中datadir,指向正确的mysql数据库文件目录
法二::新建一个链接或在mysql中加入-S参数,直接指出mysql.sock位置。ln -s /usr/local/mysql/data/mysql.sock /tmp/mysql.sock或者/usr/local/mysql/bin/mysql -u root -S /usr/local/mysql/data/mysql.sock ;
法三:mysql对配置文件要求很严格,检查my.cnf文件是否有错误字段;

错误四
Starting MySQL. ERROR! The server quit without updating PID file (/data/mysqldb/bogon.pid).
[root@bogon mysql]# vim /etc/my.cnf
19 datadir = /data/mysql/ #进程问题指定正确的数据文件即可
20 # port = …..
21 # server_id = …..
22 socket = /usr/local/mysql/mysql.sock
23
[root@bogon mysql]# chown -R mysql.mysql /usr/local/mysql/ #注意权限问题

错误五
[root@bogon src]# tar -xf php-7.2.1.tar.gz
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now
原因:格式不对,此.tar.gz结尾的文件其实为html文件
[root@bogon src]# file php-7.2.1.tar.gz
php-7.2.1.tar.gz: HTML document text
解决:寻找搜狐源:http://mirrors.sohu.com/php/

Ubuntu

问题一

Ubuntu环境, 假设这台机器名字叫abc(机器的hostname), 每次执行sudo 就出现这个警告讯息:
sudo: unable to resolve host abc
虽然sudo 还是可以正常执行, 所以就直接从/etc/hosts 设定, 让abc(hostname) 可以解回127.0.0.1 的IP 即可.
解决:在127.0.0.1 localhost 后面加上主机名称(hostname) 即可:

问题二

Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package gcc-c+
E: Couldn’t find any package by regex ‘gcc-c+’
E: Unable to locate package glibc
E: Unable to locate package libxslt-devel
E: Unable to locate package libjpeg
解决一:sudo apt-get update
解决二:可能和apt-get版本和系统版本有关,不同的系统可能对应不同的源;
解决三:源问题,查看apt源是否可用 #pcre需要ruby的支持,centos默认已经安装,而ubutun没有该包,所以需要先安装

问题三:如何知道编译安装软件时的参数

root@152:~# /usr/local/nginx -V (nginx -V)
-bash: /usr/local/nginx: is a directory
root@152:~# find / -type f -name nginx
/usr/local/i386/public_repos/initial_system/syslog/logrotate_app/nginx
/etc/init.d/nginx
/var/lib/update-rc.d/nginx
/data/ser/nginx-1.2.3/sbin/nginx
/data/ser/nginx-1.2.3_pkg/sbin/nginx
/data/ser/nginx-1.2.3_pkg/objs/nginx
/data/services/nginx-1.2.3/sbin/nginx
/data/services/nginx-1.2.3_pkg/sbin/nginx
/data/services/nginx-1.2.3_pkg/objs/nginx
root@152:~#
root@152:~# /data/ser/nginx-1.2.3/sbin/nginx -V #nginx的启动脚本
nginx version: nginx/1.2.3
built by gcc 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
configure arguments: –prefix=/data/services/nginx-1.2.3 –with-http_stub_status_module

问题四:

root@ubuntu:~# rsync -auvztp /usr/local/nginx [email protected]::nginx/ –password-file=/etc/rsync.passwd
rsync: failed to connect to 122.97.250.104 (122.97.250.104): Connection refused (111)
rsync error: error in socket IO (code 10) at clientserver.c(122) [sender=3.0.9]
解决:服务端未启动

问题五

configure: error: Cannot find ldap.h
root@ubuntu:/data/services/php-5.3.10# apt-get install openldap.x86_64 openldap-clients.x86_64 openldap-devel.x86_64 openldap-ser.x86_64
查看:root@ubuntu:/data/services/php-5.3.10# cat /etc/issue
Ubuntu 16.04 LTS \n \l #其他
查看:apt-get install libldap2-dev ldap-utils libldap-2.4-2

问题六

configure: error: Cannot find ldap libraries in /usr/lib.
root@ubuntu:/data/services/php-5.3.10#
查看:find / -name ‘libldap*’
解决:cp -rp /usr/lib/x86_64-linux-gnu/libldap* /usr/lib #!!!!及其错误,不能这么暴力,不要乱用f参数,需要恢复!!!
正确:ln -s /usr/lib/x86_64-linux-gnu/liblber.so /usr/lib/
ln -s /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/ #绿色为软链接,红色为压缩;

问题七

Makefile:720: recipe for target ‘ext/dom/node.lo’ failed
make: * [ext/dom/node.lo] Error 1
root@ubuntu:/data/services/php-5.3.10# cd /usr/lib

问题八:

Notice: Following unknown configure options were used:

–enable-apc
–enable-mongo
–enable-memcached

Check ‘./configure –help’ for available options

思考1:可能是没有安装包或者没有那些包的依赖,但是我安装了apc* libmongo-client-dev libmemcached-dev memcached mongo以后还是报相同的错
思考2:可能没有这种用法
最终解决:查阅文献后发现,这些参数即使现在不加后续也可以修改配置文件增添,因此暂时不加这些参数,后续业务有需要我再去配置

问题九

-5.3.10/Zend -I/usr/include -g -O2 -fvisibility=hidden -c /data/services/php-5.3.10/ext/dom/node.c -o ext/dom/node.lo
/data/services/php-5.3.10/ext/dom/node.c: In function ‘dom_canonicalization’:
/data/services/php-5.3.10/ext/dom/node.c:1898:21: error: dereferencing pointer to incomplete type ‘xmlBuf {aka struct _xmlBuf}’
ret = buf->buffer->use;
^
Makefile:720: recipe for target ‘ext/dom/node.lo’ failed
make: * [ext/dom/node.lo] Error 1
root@ubuntu:/data/services/php-5.3.10#

root@ubuntu:/data/services# cd php-5.3.10/
root@ubuntu:/data/services/php-5.3.10# patch -p0 -u <../php-5.3.10.patch #打补丁你值得拥有
patching file ext/dom/node.c
patching file ext/dom/documenttype.c
patching file ext/simplexml/simplexml.c
Hunk #1 succeeded at 1387 (offset -30 lines).
root@ubuntu:/data/services/php-5.3.10#

你可能感兴趣的:(linux系统)