博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
搞了个LAMP,没事也整理个问题集
阅读量:3697 次
发布时间:2019-05-21

本文共 3495 字,大约阅读时间需要 11 分钟。

目录


一、HTTPD

1.1.启动httpd服务失败

  • 问题描述
 httpd.service failed because the control process exited with error code. See “systemctl status httpd.service” and “journalctl -xe” for details
  •  解决办法
原因:刚刚修改的配置内容存在错误解决:执行httpd -t检查配置的错误情况,根据提示排错

1.2. gcc未安装导致的问题

  • 问题描述
configure: error: no acceptable C compiler found in $PATH
  •  解决办法
解决办法,安装gcc

1.3.页面错误

  • 问题描述
网页里面访问网页出现forbidden
  •  解决办法
查看主配置文件,如果是Deny from all,改为Allow对于php5.0来说,默认是Require all denied,我们需要把denied改为granted

二、MYSQL

2.1.libaio-devel依赖包缺失

  • 问题描述
error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
  • 解决办法 
解决办法 yum install -y libaio-devel

2.2.mysql访问文件权限问题

  • 问题描述
  ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid).解决办法 替换掉系统原来自带的 my.cnf : mv /etc/my.cnf /etc/my.cnf_bak (原因未知,MySQL版本号为 mysql-5.5.52-linux2.6-x86_64)a. 在一次实验当中,不知道什么原因出现了错误 ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)在网上排除了挺久的也没找到结果,然后在/data/mysql文件夹里面偶然间瞄到了一个错误日志,/data/mysql/主机名.error,错误日志如下InnoDB: The error means mysqld does not have the access rights toInnoDB: the directory.InnoDB: File name ./ibdata1
  • 解决办法 
解决办法:显然,MySQL没有权限访问这个文件,排查出整个data文件夹权限全部为root,修改权限后解决问题

2.3.数据库启动失败无法通过pid退出

  •  问题描述
Starting MySQL... ERROR! The server quit without updating PID file (/data/mysql/mysql.pid).
  • 解决办法 
关于网上对这个错误的总结,很多人都说权限问题,其实不管我们怎么给权限,好像都报错,很多时候都是因为配置文件有问题,才导致的,如果出现此错误,建议检查配置文件

 2.4.mysql端口占用

  • 问题描述
Systemctl restart mariadb.serviceJob for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.
  • 解决办法
解决方法:查看错误日志:journalctl –xe查看端口是否被占用:netstat -tnlp|grep 3306最终的判断,MYSQL进程已经存在,无法启动Mariadb,解决方法,停止原来的MYSQL服务;

 2.5.涉及mysql.sock通信文件问题

  • 问题描述
Redirecting to /bin/systemctl restart  mariadb.serviceJob for mariadb.service failed because the control process exited with error code. See "systemctl status mariadb.service" and "journalctl -xe" for details.ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'
  • 解决办法
使用journalctl –xe查看MYSQL错误信息;关闭服务器selinux安全策略,关闭防火墙setenforce 0;检查MYSQL|Mariadb通过什么样的方式部署的;检查其配置文件/etc/my.cnf,datadir数据目录是否配置;检查socket是否配置正确确认数据库的数据目录mysql用户是否拥有读写权限;检查数据库目录是否初始化,是否包括mysql、test基础库;检查socket文件所在的路径,是否存在socket文件,权限是否正确;

三、PHP

3.1.依赖包缺少(perl)

  • 问题描述
Sorry, I cannot run apxs. Possible reasons follow:The output of /usr/local/apache2/bin/apxs follows:./configure: /usr/local/apache2/bin/apxs: /replace/with/path/to/perl/interpreter: bad interpreter: No such file or directory
  • 解决办法
解决办法:因为没安装perl,先 yum install -y perl-devel ,然后修改apxs文件 ,把最上面一行改为/usr/bin/perl 解决

3.2.安装包缺少(libmcrypt-devel)

  • 问题描述
configure: error: xml2-config not found. Please check your libxml2 installation.yum install -y libxml2-develconfigure: error: Cannot find OpenSSL's 
yum install -y openssl openssl-devel   configure: error: Please reinstall the BZip2 distribution,yum install -y bzip2 bzip2-devel   configure: error: jpeglib.h not found.yum install -y libjpeg-devel   configure: error: png.h not found.yum install -y libpng libpng-devel   configure: error: freetype-config not found.yum install -y freetype freetype-devel   configure: error: mcrypt.h not found. Please reinstall libmcrypt.
  • 解决办法
yum install -y libmcrypt-devel

3.3.遇到php无法解析

  • 解决办法
1.先查看 /usr/local/apache2/bin/apachectl -M |grep 'php' ,看一下有没有装载 php5_module2.查看配置文件 /usr/local/apache2/conf/httpd.conf ,看一下有无 AddType application/x-httpd-php .php3.getenforce ,看看是否关闭了防火墙

 

转载地址:http://swucn.baihongyu.com/

你可能感兴趣的文章
@mapper
查看>>
mapper
查看>>
Controller层
查看>>
导航栏错误
查看>>
Controller ----Service ----Mapper
查看>>
Cache 缓存处理
查看>>
关于Redis闪退
查看>>
Redis cuowu
查看>>
Spring boot01
查看>>
Spring boot配置文件
查看>>
springboot-10-11
查看>>
spring-10.15 通过Aware接口使用spring底层组件
查看>>
spring-quartz-10.15框架独立使用与spring整合
查看>>
springMVC -10.21-01
查看>>
mybatis -----1023statement增删改查
查看>>
Mybatis---1023MyBatis约定及基于动态代理方式的增删改查
查看>>
Mybatis---1023两种取值符号以及ParameterType为简单、对象、嵌套对象类型
查看>>
new 1104 springcloud maven
查看>>
java基础01
查看>>
java基础04
查看>>