安装包的根目录要有index.php文件自己动手如何压缩文件安装包

安装了WampServer 2.1a 多语言集成包!但是wamp文件夹中的www目录中只有index.php可以运行_百度知道
安装了WampServer 2.1a 多语言集成包!但是wamp文件夹中的www目录中只有index.php可以运行
有试着改变端口!还是不行啊!哪位高手可以帮忙解决啊!
&#47。再运行
就可以看到指定目录下所有文件了.html等文件;E;
:/apache2。按你说的 应该你的目录下有一个index文件, 我的是;还有就是 &&gt:DocumentRoot &space/E。你看你的\然后看你的这个目录下都有什么文件.8&#92.conf&#92不要做什么操作啊;
这个也要改成你的目录 。找到 DocumentRoot 看到指向的目录是哪里;Directory &space&#47。你把这些文件删了;&quot。PHP默认会读取&wamp&#92.2.conf 这个配置文件;bin\apache&#92
其他类似问题
为您推荐:
wampserver的相关知识
其他2条回答
你现在是不能运行还是怎么了
在配置文件添加 其它的后缀
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁YII2.0自带的有2个项目目录一个是前台的frontend和后台的backend,访问的时候必须访问至http://localhost:8080/phpblog/backend/web/index.php?r=admin/index,这样好像很麻烦,而且难记,于是我们把访问的地址配置成http://localhost:8080/phpblog/admin.php这种的就好记很多了.
首先在backend下面找到web目录:
把里面的index.php复制到根目录并改名字为admin.php:
修改admin.php里面的内容为:
defined('YII_DEBUG') or define('YII_DEBUG', true);
defined('YII_ENV') or define('YII_ENV', 'dev');
require(__DIR__ . '/vendor/autoload.php');
require(__DIR__ . '/vendor/yiisoft/yii2/Yii.php');
require(__DIR__ . '/common/config/bootstrap.php');
require(__DIR__ . '/backend/config/bootstrap.php');
#require(__DIR__ . '/common/config/autoload.php');
$config = yii\helpers\ArrayHelper::merge(
require(__DIR__ . '/common/config/main.php'),
require(__DIR__ . '/common/config/main-local.php'),
require(__DIR__ . '/backend/config/main.php'),
require(__DIR__ . '/backend/config/main-local.php')
$application = new yii\web\Application($config);
$application-&language='zh-CN';
$application-&defaultRoute='admin';
$application-&run();下面进行js,css路径修改:
找到backend目录下面的assets目录下面的AppAsset.php,修改内容
class AppAsset extends AssetBundle
public $basePath = '@webroot';
public $baseUrl = '@web';
//全局的js和css,主要是修改这里的路径,原来的@web不能使用了,要写backend的全路径了,按照下面的写就可以了
public $css = [
'backend/web/scripts/css/default.css',
'backend/web/scripts/js/jquery-easyui-1.4.3/themes/icon.css',
'backend/web/scripts/js/jquery-easyui-1.4.3/themes/easyui_icons.css',
'backend/web/scripts/js/jquery-easyui-1.4.3/themes/default/easyui.css'
public $js = [
'backend/web/scripts/js/jquery-easyui-1.4.3/jquery.min.js',
'backend/web/scripts/js/jquery-easyui-1.4.3/jquery.easyui.min.js'
public $depends = [
//定义按需加载JS方法,注意加载顺序在最后
public static function addScript($view, $jsfile) {
$view-&registerJsFile($jsfile, ['depends'=&['backend\assets\AppAsset']]);
//定义按需加载css方法,注意加载顺序在最后
public static function addCss($view, $cssfile) {
$view-&registerCssFile($cssfile, ['depends'=&['backend\assets\AppAsset']]);
}继续修改backend下面的config目录下面的main.php:
$params = array_merge(
require(__DIR__ . '/../../common/config/params.php'),
require(__DIR__ . '/../../common/config/params-local.php'),
require(__DIR__ . '/params.php'),
require(__DIR__ . '/params-local.php')
'id' =& 'app-backend',
'basePath' =& dirname(__DIR__),
'bootstrap' =& ['log'],
'controllerNamespace' =& 'backend\controllers',
'components' =& [
//添加了这个配置
'assetManager' =& [
'basePath' =& '@webroot/backend/web/assets',
'baseUrl' =& '@web/backend/web/assets'
'user' =& [
'identityClass' =& 'common\models\User',
'enableAutoLogin' =& true,
'log' =& [
'traceLevel' =& YII_DEBUG ? 3 : 0,
'targets' =& [
'class' =& 'yii\log\FileTarget',
'levels' =& ['error', 'warning'],
'errorHandler' =& [
'errorAction' =& 'site/error',
'params' =& $params,
];控制器一定要和配置的defaultRoute默认路由对应,我们配置的是admin,那么就要有对应的AdminController.php,里面的方法必须为actionIndex,这样访问的时候就可以直接运行里面的view了:
运行效果:
希望可以帮助到大家。
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:14521次
排名:千里之外
原创:75篇
(1)(1)(3)(2)(1)(7)(2)(3)(2)(14)(1)(7)(15)(9)(4)(3)(6)(3)(2)Nginx下安装CodeIginter及配置 - 简书
下载简书移动应用
写了7349字,被12人关注,获得了14个喜欢
Nginx下安装CodeIginter及配置
CodeIgniter框架安装很简单,只需要到将压缩包下载下来解压,放到服务器根目录即可。
比如,我在nginx服务器根目录下创建一个文件夹ci,并将CodeIgniter框架代码解压到这个文件下。
ci文件夹下包含上面这些内容。
打开浏览器,输入:http://127.0.0.1/ci/index.php,显示欢迎界面,表示CodeIgniter框架可以使用了。
ci欢迎界面
CodeIgniter框架默认访问welcome控制器下的index方法,上面输出内容就是index方法输出的结果。
下面我们来实现一个自己的控制器,在application/controllers文件夹下创建一个文件Hello.php,即创建一个hello控制器。内容如下:
defined('BASEPATH') OR exit('No direct script access allowed');
class Hello extends CI_Controller {
public function index() {
echo 'I am in hello controller index function!';
public function test() {
echo 'I am in
hello controller test function!';
打开浏览器,输入:http://127.0.0.1/ci/index.php/hello/index,由于我们访问的不是默认控制器和方法,必须输入要访问的控制器名和方法名。
访问返回404,但如果使用的是apache服务器时,上面链接可以正常访问。这是因为对于/index.php/hello/index这种url,Apache会按‘/index.php?hello/index’来解释,而nginx认为请求的是index.php/hello/index目录下的文件。所以CodeIgniter框架在nginx下需要特别的配置才可以使用。
打开nginx配置文件,修改之前如下(只显示部分):
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
include snippets/fastcgi-php.
# With php5-cgi alone:
fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.
当我们输入http://127.0.0.1/ci/index.php/hello/index地址时,nginx会匹配进入location /块。
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
上面location中只有一条命令try_files $uri $uri/ =404;针对上面的访问地址,$uri为/ci/index.php/hello/index,$uri/为/ci/index.php/hello/index/,注意加斜线表示目录,try_files命令首先查找/ci/index.php/hello/index文件是否存在,如果存在直接返回该文件。如果不存在,继续检查/ci/index.php/hello/index/目录是否存在,如果存在直接返回该目录中的index.html或index.php文件,如果目录也不存在就返回404。
为了验证try_files命令是否是这样执行,我们可以在/ci/index.php/hello/index/中创建一个index.html,内容为:This is index.html!。
再输入地址http://127.0.0.1/ci/index.php/hello/index,浏览器显示:
下面我们修改nginx配置,让nginx支持CodeIgniter。其实只要改try_files $uri $uri/ =404;这条命令就可以了,当nginx找不到文件和目录时,不返回404,而是重定向到index.php入口文件。
location /ci/ {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /ci/index.
再输入地址http://127.0.0.1/ci/index.php/hello/index,浏览器显示:
现在nginx可以支持CodeIgniter了。实际上我们也可以http://127.0.0.1/ci/hello/index这样访问,不包含index.php,是不是url简洁很多。
另外上面的配置也可以使用nginx的rewrite命令实现。具体配置如下:
location /ci/ {
if (!-e $request_filename) {
/ci/index.php?$1
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
打开微信“扫一扫”,打开网页后点击屏幕右上角分享按钮
被以下专题收入,发现更多相似内容:
互联网编程、web、it
· 3029人关注
我们就在这里聊一聊PHP开发中的趣事,经验,干货,以及遇到的问题进行交流。
· 1000人关注
这里只有干货,理论+代码, 希望广大PHPER踊跃投稿。
· 94人关注
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
选择支付方式:您好!欢迎光临赵容部落O(∩_∩)O~
wordpress安装在网站根目录修改index.php
wordpress安装在网站根目录修改index.php
今天在逅客北极看到一片博文,大致是写的安装WP之后出错的解决方法,不过他的修改方式很值得我们借鉴。
很多朋友是申请国外的免费空间来玩WP,包括我,我就是用三蛋的空间做的,有些免费空间很多的系统文件,不可以删除的,当你直接把WP里面的文件放在网站根目录,当不满意希望重做的时候,很容易不小心删除了系统文件,这时候,我们把WP整个目录传上去就好多了,这时候访问你的博客地址就是你的网址/wordpress/,但是逅客提供了一种不用访问根目录的方法,在此分享,未经测试,但希望大家测试!
将 /public_html/wordpress目录下的 index.php 复制一份上传到到根目录/public_html下,并且修改下面这行
require(&./wp-blog-header.php&);
require(&./wordpress/wp-blog-header.php&);
然后保存。}

我要回帖

更多关于 当前卷根目录被压缩 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信