在Linux系统中安装LAMP出现的错误总结推荐

在linux系统中使用源代码安装虽然是最好的,但但出现的问题也是最多的,现在我总结一下用源代码安装LAMP环境中遇到常见的错误,一般错误是没有安装依赖库文件所导致的.

错误1.checkingfortermcapfunctionslibrary…configure:error:Nocurses/termcaplibraryfound

解决方法:yuminstallncurses–缺少ncurses安装包

错误2.安装gd库出现以下错误:Infileincludedfrom/root/php-5.3.6/ext/gd/libgd/gd_compat.c:8:/usr/local/jpeg/include/jpeglib.h:938:error:expecteddeclarationspecifiersor‘…’before‘FILE’/usr/local/jpeg/include/jpeglib.h:939:error:expecteddeclarationspecifiersor‘…’before‘FILE’make:***[ext/gd/libgd/gd_compat.lo]Error1解决方法:vimphp-5.3.6/ext/gd/libgd/gd_compat.c#include png.h –修改为#include /usr/local/libpng/include/png.h #include stdio.h –添加这行

错误3.Configure:error:xml2-confignotfound.Pleasecheckyourlibxml2installation.

解决方法:yuminstalllibxml2libxml2-devel

错误4.Configure:error:PleasereinstalltheBZip2distribution

解决方法:yuminstallbzip2bzip2-devel

错误5.Configure:error:libjpeg.(also)notfound.

解决方法:yuminstalllibjpeglibjpeg-devel

错误6.没有安装snmp开发包

checkingforSNMPsupport…yescheckingOpenSSLdirforSNMP…nocheckingwhethertoenableUCDSNMPhack…nocheckingfornet-snmp-config…(cached)/usr/bin/net-snmp-configconfigure:error:snmp.hnotfound.CheckyourSNMPinstallation.[root@redhat1php-5.2.17]#

解决方法:yuminstallnet-snmpnet-snmp-devel

错误7.apache端口被占用了

[root@redhat1bin]#./httpd(98)Addressalreadyinuse:make_sock:couldnotbindtoaddress[::]:80(98)Addressalreadyinuse:make_sock:couldnotbindtoaddress0.0.0.0:80nolisteningsocketsavailable,shuttingdownUnabletoopenlogs[root@redhat1bin]#

解决方法:80端口被占用了,杀掉占用80端口的进程

错误8.没有指定主机IP地址

[root@redhat1bin]#./httpdhttpd:Couldnotreliablydeterminetheserver’sfullyqualifieddomainname,using2.2.2.117forServerName[root@redhat1bin]#

解决方法:vim/usr/local/apache/conf/httpd.conf

ServerNamelocalhost–添加这一行就可以了

错误9.访问网站时出现下载页面

解决方法:vim/usr/local/apache/conf/httpd.conf–加载php模块

LoadModulephp5_modulemodules/libphp5.so

错误10.访问网站出现“couldnotfinddriver”,提示没有设备

解决方法:http://localhost/index.php

查看PDO中是否支持mysql数据库,如果不支持则编译安装要添加–with-pdo-mysql–with-pdo-pgsql–without-pdo-sqlite,详细参数如下:

./configure–prefix=/usr/local/php-5.2.17–with-apxs2=/usr/local/apache/bin/apxs–with-mysql=/usr/local/mysql/–with-mysqli=/usr/local/mysql/bin/mysql_config–with-gd–with-jpeg-dir–with-freetype-dir–with-ldap–with-snmp–with-curl–with-openssl–enable-ftp–enable-xml–enable-mbstring–with-pdo-mysql–with-pdo-pgsql –without-pdo-sqlite

错误11.提示没有apr包

checkingtargetsystemtype…x86_64-unknown-linux-gnuconfigure:configure:ConfiguringApachePortableRuntimelibrary…configure:checkingforAPR…configure:error:–with-aprrequiresadirectoryorfiletobeprovided[root@node2httpd-2.4.9]#

解决方法(需要安装apr包):

[root@node2]#wgethttp://mirrors.hust.edu.cn/apache//apr/apr-1.5.1.tar.gz[root@node2]#tarxvfapr-1.5.1.tar.gz[root@node2]#cdapr*[root@node2apr]#./configure–prefix=/usr/local/apr[root@node2apr]#make[root@node2apr]#makeinstall[root@node2apr]#cdhttpd-2.4.9[root@node2httpd-2.4.9]#./configure–prefix=/usr/local/apache\–enable-cache–enable-cache-disk–enable-so–enable-proxy\-enable-proxy-http–enable-dav–enable-cgi–enable-rewrite\-with-pcre–with-apr=/usr/local/apr/bin/apr-1-config

错误12.显示没有apr-util包

exports.c:1890:note:previousdefinitionof’ap_hack_apr_gid_get’washereexports.c:2630:error:redefinitionof’ap_hack_apr_version’exports.c:1908:note:previousdefinitionof’ap_hack_apr_version’washereexports.c:2631:error:redefinitionof’ap_hack_apr_version_string’exports.c:1909:note:previousdefinitionof’ap_hack_apr_version_string’washeremake[2]:***[exports.lo]Error1make[2]:Leavingdirectory`/root/httpd-2.4.9/server’make[1]:***[all-recursive]Error1make[1]:Leavingdirectory`/root/httpd-2.4.9/server’make:***[all-recursive]Error1[root@node2httpd-2.4.9]#

解决方法:

[root@node2~]#wgethttp://apache.fayea.com/apache-mirror//apr/apr-util-1.5.3.tar.gz[root@node2~]#tarxvfapr-util-1.5.3.tar.gz[root@node2~]#cdapr-util-1.5.3[root@node2apr-util-1.5.3]#./configure–prefix=/usr/local/apr-util–with-apr=/usr/local/apr/[root@node2~]#cdhttpd-2.4.9[root@node2httpd-2.4.9]#./configure–prefix=/usr/local/apache\–enable-cache–enable-cache-disk–enable-so–enable-proxy\–enable-proxy-http–enable-dav–enable-cgi–enable-rewrite\–with-pcre–with-apr=/usr/local/apr/bin/apr-1-config\–with-apr-util=/usr/local/apr-util/\–加入这个选项–with-apr-util=/usr/local/apr-util/

错误13.apache服务启动正常,端口打不开

[root@node2bin]#./apachectlstart[root@node2bin]#netstat-anp|grep:80[root@node2bin]#./httpd[root@node2bin]#netstat-anp|grep:80[root@node2bin]#

解决方法:

[root@node2bin]#vim../logs/error_log–从日志上看文件没有加载slotmem模块[TueApr2912:05:02.2341252014][mpm_event:notice][pid653:tid140181975127808]AH00491:caughtSIGTERM,shuttingdown[TueApr2912:05:07.3202592014][proxy_balancer:emerg][pid1239:tid139638802343680]AH01177:Failedtolookupprovider’shm’for’slotmem’:ismod_slotmem_shmloaded??[TueApr2912:05:07.3209432014][:emerg][pid1239:tid139638802343680]AH00020:ConfigurationFailed,exiting[TueApr2912:05:34.7084992014][proxy_balancer:emerg][pid1243:tid140149584029440]AH01177:Failedtolookupprovider’shm’for’slotmem’:ismod_slotmem_shmloaded??[TueApr2912:05:34.7092352014][:emerg][pid1243:tid140149584029440]AH00020:ConfigurationFailed,exiting[root@node2bin]#vim../conf/httpd.confLoadModuleslotmem_shm_modulemodules/mod_slotmem_shm.so–打开这个模块[root@node2bin]#./apachectlstart[root@node2bin]#netstat-anp|grep:80–成功了tcp00:::80:::*LISTEN1415/httpd[root@node2bin]#

错误14.安装php5.3.28出错

checkingforpoll…yescheckingforselect…yesconfigure:error:+——————————————————————–+|***ATTENTION***||||You’veconfiguredmultipleSAPIstobebuild.Youcanbuildonly||oneSAPImoduleandCLIbinaryatthesametime.|+——————————————————————–+[root@node2php-5.3.28]#

解决方法:

[root@node2php-5.3.28]#./configure–prefix=/usr/local/php\–with-apxs2=/usr/local/apache/bin/apxs\–with-mysql=/usr/local/mysql/–with-zlib–with-curl\–enable-dba–enable-ftp–with-jpeg-dir–with-png-dir\–with-freetype-dir–with-ldap–enable-mbstring\–with-mcrypt–with-mysqli=/usr/local/mysql/bin/mysql_config\–with-pdo-mysql–with-pdo-pgsql–without-pdo-sqlite\–with-pgsql–with-pcre-dir–enable-zip–将enable-fpm和-with-apxs2=…….只须加一个就行了

错误15.缺少postgresql-devel包

checkingformysql_sqlstate…yescheckingforPDOincludes…checkingforPDOincludes…/root/php-5.3.28/extcheckingOracleOCIsupportforPDO…nocheckingforODBCv3supportforPDO…nocheckingforPostgreSQLsupportforPDO…yescheckingforpg_config…notfoundconfigure:error:Cannotfindlibpq-fe.h.PleasespecifycorrectPostgreSQLinstallationpath[root@node2php-5.3.28]#

解决方法:

[root@node2php-5.3.28]#yuminstallpostgresql-devel[root@node2php-5.3.28]#yuminstallpdo*

错误16.在编译php5.3.28时出错

hp-5.3.28/ext/mbstring/libmbfl-I/root/php-5.3.28/ext/mbstring/libmbfl/mbfl-I/usr/local/mysql//include/mysql-I/usr/local/my3.28/Zend-D_REENTRANT-I/usr/include-g-O2-fvisibility=hidden-pthread-DZTS-c/root/php-5.3.28/ext/standard/basic_fuInfileincludedfrom/root/php-5.3.28/ext/standard/basic_functions.c:49:/root/php-5.3.28/Zend/zend_language_parser.h:317:error:conflictingtypesfor?.endparse?/root/php-5.3.28/Zend/zend_globals_macros.h:35:note:previousdeclarationof?.endparse?.washeremake:***[ext/standard/basic_functions.lo]Error1[root@node2php-5.3.28]#

解决方法:

把zend_language_parser.h文件中317行的内容intzendparse(void*)与zend_globals_macros.h35行intzendparse(void*compiler_globals);弄成一致。再进行make可以成功。

其实,每个人都是幸福的。只是,你的幸福,常常在别人眼里。

在Linux系统中安装LAMP出现的错误总结推荐

相关文章:

你感兴趣的文章:

标签云: