安装php URL重写 mod_rewrite
[root@66 bin]# pwd
/usr/local/apache/bin
[root@66 bin]# find / -name mod_rewrite.c
/usr/local/httpd-2.2.9/modules/mappers/mod_rewrite.c
[root@66 bin]# ./apxs -i -a -c /usr/local/httpd-2.2.9/modules/mappers/mod_rewrite.c
/usr/local/apache/build/libtool --silent --mode=compile gcc -prefer-pic -DLINUX=2 -D_REENTRANT -
略....
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
chmod 755 /usr/local/apache/modules/mod_rewrite.so
[activating module `rewrite' in /usr/local/apache/conf/httpd.conf]
[root@66 bin]# ./apachectl restart
如果没有什么错误的话,会在apache/modules目录中编译出一个mod_rewrite.so文件。
并会在自动在httpd.conf中加载,如果没有自动加载,手工修改httpd.conf文件
vi /usr/local/apache/conf/httpd.conf
LoadModule rewrite_module modules/mod_rewrite.so
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步