大网数据广告活动
服务器运维问答

CentOS“-bash: a2enmod: command not found”

· 52CE 我爱测

when I configured pnp4nagios,the following questions happened. PHP GD extension→ PHP GD extension not available PHP zlib extension→ PHP zlib extension not available PHP socket extension→ PHP socket extension not available Apache …

问题原文

原帖链接 · liangzhitao · CC BY-SA 3.0

when I configured pnp4nagios,the following questions happened.

PHP GD extension→ PHP GD extension not available

PHP zlib extension→ PHP zlib extension not available

PHP socket extension→ PHP socket extension not available

Apache Rewrite Module→ Apache mod_rewrite is not enabled

google told me perhaps my php was broken during the installation. Also,I got this pageenabling-mod-rewrite-on-ubuntu

But,my server is CentOS,I carried out the command "a2enmod rewrite",the result is "-bash: a2enmod: command not found"……

What can I do?Thanks.

社区高分解答

原帖链接 · sridhar pandurangiah · CC BY-SA 3.0

PHP zlib and sockets are part of php-common. Install php-gd and php-common

yum install php php-gd php-common

to enable sockets find the PHP configuration directory and run the following commands in the terminal

./configure --enable-sockets
make && make install

Apache rewrite module allows URL rewriting. It's enabled by Default in Centos 7. Check if it's already enabled in your version. The following command outputs a list of Apache modules that are currently enabled:

httpd -M

If it is not already enabled, you will need to enable it by modifying the configuration file

sudo nano /etc/httpd/conf.modules.d/00-base.conf

and include the following line

LoadModule rewrite_module modules/mod_rewrite.so

Save the file and restart the Apache server

sudo systemctl restart httpd

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2013-12-02)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。