php环境搭建以及优化
WampServer 配置伪静态
httpd.conf文件
搜索找到“LoadModule rewrite_module modules/mod_rewrite.so”这一行,去掉前面的“#”;
搜索找到“LoadModule rewrite_module modules/mod_rewrite.so”这一行,去掉前面的“#”;
新建.haccess文件,放在当前网站根目录下,在.haccess文件中添加伪静态规则
<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>
Apache访问权限
找到:apache文件,进入conf文件,打开httpd.conf 文件,做如下修改:
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Satisfy all
</Directory>
修改成
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
# Deny from all
Allow from all
#允许所有访问
Satisfy all
</Directory>
第二处:找到并替换以下内容:
<Directory "D:/wampserver/www/">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride all
#
# Controls who can get stuff from this server.
#
# onlineoffline tag - don't remove
Require all granted
</Directory>
Apache下目录禁止访问
在Options Indexes FollowSymLinks中删除Indexes。
即: Options FollowSymLinks
【备注:Indexes的作用就是默认查找index文件,如果没有就展示目录下面所有文件,去掉就禁止访问】
这样的话就属于整个Apache禁止目录浏览了。
如果是在虚拟主机中,只要增加如下信息就行:
<Directory “D:test”>
Options -Indexes FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>
这样的话就禁止在test工程下进行目录浏览。
备注: 切记莫把“Allow from all”改成 “Deny from all”,否则,整个网站都不能被打开。
<Finished>
还有一种方法:
可以在根目录的 .htaccess 文件中输入
<Files *>
Options -Indexes
</Files>
就可以阻止Apache 将目录结构列表出来。
php.ini文件配置
时间配置PRC中国
date.timezone = PRC
文件上传
file_uploads = On //支持http上传
upload_tmp_dir = //临时文件保存路径
upload_max_filesize = 2M //上传的大小限制
post_max_size = 10M //post提交的大小限制
max_file_uploads = 20 //允许一次上传的最大文件数
XDEBUG设置,函数嵌套循环次数:
报错内容:Fatal error: Maximum function nesting level of '100' reached, aborting!
解决办法
查找xdebug 找到zend_extension = “D:/wamp/bin/php/php5.3.13/zend_ext/php_xdebug-2.2.0-5.3-vc9-x86_64.dll” 这句在前面加;注视掉,在后面加上
xdebug.max_nesting_level = 500
php环境搭建以及优化的更多相关文章
- Ionic2开发环境搭建、项目创建调试与Android应用的打包、优化
Ionic2开发环境搭建.项目创建调试与Android应用的打包.优化. windows下ionic2开发环境配置步骤如下: 下载node.js环境,稳定版本:v6.9.5 下载android stu ...
- 128M小内存VPS优化与typecho环境搭建
在使用Haphost提供的128M内存的VPS建站时,debian7+wordpress+nginx+mysql跑起来相当吃力.然后使用Debian7+typecho+lighttpd+sqlite的 ...
- .Net Core 系列:1、环境搭建
前言: 2016年6月28日微软宣布发布 .NET Core 1.0.ASP.NET Core 1.0 和 Entity Framework Core 1.0. .NET Core是微软在两年前发起的 ...
- 搜索引擎Solr系列(一): Solr6.2.1环境搭建
一:Solr简介 Solr是一个独立的企业级搜索应用服务器,它对外提供类似于Web-service的API接口.用户可以通过http请求,向搜索引擎服务器提交一定格式的XML文件,生成索引:也可以通 ...
- Windows Server 2012上PHP运行环境搭建的简易教程(Win08适用)
微软的Windows Server 2012发布后,第一时间进行了简单的试用,非常不错,特写了个简易的PHP环境搭建教程.先来欣赏下Win2012的登录界面吧第一步我们需要安装IIS81.点击任务栏最 ...
- mingw64环境搭建
转自:http://www.cr173.com/soft/132367.html MinGW64位版,默认编译出来是64位的,需要编译32位请使用-m32 参数!mingw是一款gnu工具集合是Min ...
- CentOS下Web服务器环境搭建LNMP一键安装包
CentOS下Web服务器环境搭建LNMP一键安装包 时间:2014-09-04 00:50来源:osyunwei.com 作者:osyunwei.com 举报 点击:3797次 最新版本:lnmp- ...
- solr环境搭建
介绍摘自百度百科:Solr是一个独立的企业级搜索应用服务器,它对外提供类似于Web-service的API接口.用户可以通过http请求,向搜索引擎服务器提交一定格式的XML文件,生成索引:也可以通过 ...
- 基于Maven的Springboot+Mybatis+Druid+Swagger2+mybatis-generator框架环境搭建
基于Maven的Springboot+Mybatis+Druid+Swagger2+mybatis-generator框架环境搭建 前言 最近做回后台开发,重新抓起以前学过的SSM(Spring+Sp ...
随机推荐
- Java JsonPath grab InvalidPathException in code, you must be catching Java 7's java.nio.file.InvalidPathException instead of JsonPath's com.jayway.jsonpath.InvalidPathExceptio
I am using JsonPath and am able to parse my data and get the values when the path provided is correc ...
- 多级xml解析方案
package com.people.xmlToSql; import java.io.File; import java.io.IOException; import java.io.StringW ...
- nginx的安装和负载均衡例子(RHEL/CentOS7.4)
首先安装RHEL/CentOS7.4 mini ,然后关闭防火墙和 selinux ,更新系统(参看配置linux使用本地yum安装源和Redhat7/CentOS7 关闭防火墙和 selinux两个 ...
- appium常见问题08_pycharm中导入appium报错( 已成功安装appium_python_client)【MAC】
问题: 成功安装配置好python+appium自动化环境后,其中appium-python-client已安装好.但是在pycharm中编写自动化脚本时,导入appium,发现appium报红无法使 ...
- linux在二进制文件中查找pattern的offset
参考:http://stackoverflow.com/questions/14141008/grep-offset-of-ascii-string-from-binary-file strings ...
- Ubuntu安装程序提示无法获得锁
目录 1.问题描述 2.问题原因 3.解决方案 3.1方法一:杀掉apt-get进程 3.2方法二:强制解锁 1.问题描述 E: 无法获得锁 /var/lib/dpkg/lock-frontend - ...
- Dubbo 系列(07-5)集群容错 - Mock
Dubbo 系列(07-5)集群容错 - Mock [toc] Spring Cloud Alibaba 系列目录 - Dubbo 篇 1. 背景介绍 相关文档推荐: Dubbo 实战 - 服务降级 ...
- maven项目使用tomcat启动报错:Server Tomcat v8.5 Server at localhost failed to start
背景说明:1)该项目为maven项目,使用的maven的本地仓库里有不少之前使用过下载的jar包: 2)从svn下载该项目后,无报错情况: 3)部署到tomcat启动报错 如下 : 4)在网上搜索了很 ...
- cookie,seesion学习
一,为什么需要cookie和session? 1,Web应用程序是使用HTTP协议传输数据的.然而HTTP协议是无状态的协议.一旦数据交换完毕,客户端与服务器端的连接就会关闭,再次交换数据需要建立新的 ...
- [转]Linux Shell编程入门
转自:http://www.cnblogs.com/suyang/archive/2008/05/18/1201990.html 从程序员的角度来看, Shell本身是一种用C语言编写的程序,从用户的 ...