ubuntu隐藏index.php的方法-PHP问题

资源魔 30 0

ubuntu暗藏index.php的办法

ubuntu-apache下暗藏thinkphp入口文件index.php

依照thinkphp手册中来说,apache效劳器下,暗藏thinkphp入口文件有3步:

1.httpd.conf设置装备摆设文件中加载了mod_rewrite.so模块

2.AllowOverride None 将None改成 All

3.把上面的内容保留为.htaccess文件放到使用入口文件的同级目次下:

mod_rewrite.c>
RewriteEngine
on
RewriteCond
%{REQUEST_FILENAME}
!-d
RewriteCond
%{REQUEST_FILENAME}
!-f
RewriteRule
^(.*)$
index.php/$1 [QSA,PT,L]

ps:前两项正在apache设置装备摆设文件中

但正在实际操作中发现几个成绩:

1.正在ubuntu下不httpd.conf设置装备摆设文件,只有apache2.conf,听说前者是用户自界说设置装备摆设文件

2.apache2.conf中不mod_rewrite.so(windows中把设置装备摆设文件中蕴含这行的代码正文去掉便可实现设置装备摆设)

处理方法:

a.终端:a2enmod rewrite ,实现后重启效劳器

b.做启动链接(下次启动主动加载)(我正在执行时提示说曾经存正在了):

ln -s /etc/apache2/mods-available/rewrite.load
/etc/apache2/mods-enabled/rewrite.load

重启效劳器

更多相干常识,请存眷 PHP中文网!!

以上就是ubuntu暗藏index.php的办法的具体内容,更多请存眷资源魔其它相干文章!

标签: php教程 ubuntu php故障解决 php使用问题 index.php

抱歉,评论功能暂时关闭!