关于网友提出的“ 宝塔面板配置的LAMP,上传thinkPHP,访问报错File not found,修改htaccess则出现无法加载资源”问题疑问,本网通过在网上对“ 宝塔面板配置的LAMP,上传thinkPHP,访问报错File not found,修改htaccess则出现无法加载资源”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:
问题: 宝塔面板配置的LAMP,上传thinkPHP,访问报错File not found,修改htaccess则出现无法加载资源
描述:本人菜鸟,用宝塔面板配置的LAMP,上传thinkPHP 3.2.3(代码在wamp中测试可用)。
访问http://www.xxx.me/Home/Index/... 直接报错File not found,console显示:
Failed to load resource: the server responded with a status of 404 (Not Found)
此时的.htaccess为默认的
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
.htaccess修改为以下之后就能访问http://www.xxx.me/Home/Index/... 了
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?s=/$1 [QSA,PT,L]
但是引用自public的图片和js均无法显示,例如console显示
http://kusima.me/public/js/jq... Failed to load resource: the server responded with a status of 404 (Not Found)
直接打开http://www.xxx.me/public/js/j...会报错
无法加载模块:Public
补充说明:
文件目录是TP默认的如下

入口文件是默认的定义
// 定义应用目录
define('APP_PATH','./Application/');
[ Apache ]也有相应配置
httpd.conf配置文件中加载了mod_rewrite.so模块
AllowOverride None 将None改为 All
配置文件中已设置url模式
'URL_MODEL' => 1,
这一切在wamp中测试均无出错。
请教大家,不知道哪里出错了??
解决方案1:多谢各位。
自己查到原因了,linux中要注意严格区分大小写。
犯了低级错误。
以上介绍了“ 宝塔面板配置的LAMP,上传thinkPHP,访问报错File not found,修改htaccess则出现无法加载资源”的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/4333909.html