今天买了阿里云的虚拟主机,然后把我的项目上传。
网站首页能够访问,但是点开任何页面,都是提示No input file specified,猜测应该是URL重写没有生效,我在浏览器地址把index.php加上去,就可以访问子页面了。
解决方法是:
1、关于URL重写,与ThinkPHP手册不同个地方,是入口文件的同级.htaccess文件中,index.php后面多个斜杠,如下面的代码
<IfModule mod_rewrite.c><span style="color: #000000;"> Options </span>+<span style="color: #000000;">FollowSymlinks RewriteEngine On RewriteCond </span>%{REQUEST_FILENAME} !-<span style="color: #000000;">d RewriteCond </span>%{REQUEST_FILENAME} !-<span style="color: #000000;">f RewriteRule </span>^(.*)$ index.php\/$1 [QSA,PT,<span style="color: #000000;">L] </span></IfModule>/
2、开启阿里云的PHP环境函数
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号