mod_auth_mysql.c:269:10: fatal error: mysql.h: No such file or directory

阿里云服务器搭建云上博客的时候:
输入指令:

yum -y install httpd httpd-manual mod_ssl mod_perl mod_auth_mysql

报错:
No match for argument: mod_auth_mysql
Error: Unable to find a match: mod_auth_mysql

想着mod_auth_mysql应该是没有安装,就各种搜索找到了下面的文章:

CentOS 7下httpd-2.4.6的mod_auth_mysql安装及配置
但是在修改源码之后编译时报错:
mod_auth_mysql.c:269:10: fatal error: mysql.h: No such file or directory #include <mysql.h>
compilation terminated.
apxs:Error: Command failed with rc=65536

解决方案:

安装mysql-devel:yum install mysql-devel

如果出现如下错误:
Cannot download file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql: All mirrors were tried
The downloaded packages were saved in cache until the next successful transaction.

参考https://blog.csdn.net/chongji1262/article/details/100735271
没有的话就继续
重新编译就会解决

如果出现错误:
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
apxs:Error: Command failed with rc=65536

安装zlib:yum install zlib-devel

按照第一篇文章重新编译:apxs -c -L/usr/lib64/mysql -I/usr/include/mysql -lmysqlclient -lm -lz mod_auth_mysql.c即可

但是
重新输入指令yum -y install httpd httpd-manual mod_ssl mod_perl mod_auth_mysql
还是会报No match for argument: mod_auth_mysql
Error: Unable to find a match: mod_auth_mysql
,也不知道为啥,更新了yum源之后也没有用欢迎大佬指点。

安装php-imap的时候出现
No match for argument: php-imap
Error: Unable to find a match: php-imap

出现No match for argument问题的时候:可能是yum源没有更新,要更新yum源,再进行安装
centOS8:

rm -rf /etc/yum.repos.d/Centos-Base.repo
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
yum makecache

CentOS/RHEL 7.x:

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

CentOS/RHEL 6.x:

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm

更新后重新安装即可

  • 8
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 15
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 15
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值