Home php教程 php手册 PHP has encountered an Access Violation 错误的解决方法

PHP has encountered an Access Violation 错误的解决方法

Jun 13, 2016 pm 12:19 PM
access has php wordpress build method of solve mistake

搭建wordpress的时候发觉居然会报这种错误,网上的解决方案都是千篇一律的复制粘贴,都是关于eaccelerator的设置问题,我很奇怪我并没有安装这个扩展啊?不过倒是安装过APC扩展,两种扩展都是优化服务器做底层代码支持,实现缓存共享。将APC关闭就不报错了。

一般是因为eaccelerator的问题
解决方法如下:
php for windows的bug
参考:

第一种可能:

去掉 php中 eaccelerator 的扩展
这样做能够解决您的问题,不过可能会加重系统负担
因为eaccelerator主要是为了节省系统资源的东西

具体做法是找到php.ini
如果是我帮您配置的,一般在c:/php/php.ini或者 c:/winnt/php.ini 或者c:/windows/php.ini

去掉

复制代码 代码如下:


zend_extension_ts="C:\php\extensions\eaccelerator_win_xxx.dll"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="c:\temp"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"


ea主要是在unix环境下开发的,但是作者忽略到windows实际上不像u主机那样,是没有u主机的那种内存共享机制的
这个bug已经提交给他们了,希望0.9.5能够解决

当然,如果您的机器这个问题不严重,建议还是保留,ea是一块非常优秀的Php缓存+加速软件
配合zo使用,将会降低系统负担 50%-80%左右,提高负载能力、速度和效率 200%左右

第二种可能

session_save_path 需要设定一个实际的物理路径,并且该目录需要everyone的所有权限,类似U主机的0777

第三种可能
c:/winnt/temp 或者 c:/windows/temp
也需要everyone的所有权限,类似U主机的0777

第四种可能
您的内存严重不足,查看一下,如果有问题,请加内存,最好是一次加两条
比如加1G内存,最好是加2条一模一样的512M。否则没有启用双通道,效果也很一般

第五种可能
ZendOptimizer和php的搭配不是很好
换个版本试试看
目前比较稳定的搭配是
php4.3.11+zo 2.5.10a
或者php4.4.1+zo 3.0 beta2

第六种可能

这种多属于用win2003的用户
他们在应用池中设定了限制
比如多长时间回收,最大使用内存多少等等
这些设置势必造成这个经典的php错误

很多人说,是php版本的问题,其实不然,可以从四个地方来看这个问题
1,是否zend所需的dll文件所在目录给的权限不够,必须有读取和运行的权限
2,是否使用的2003,设置过应用池,比如池中限制了什么什么,调整一下再试试看,是否好了,呵呵
3,php.ini有两个地方没有设置,而且一些程序必须用到的

A
将;upload_tmp_dir该行的注释符,即前面的分号“;”去掉,使该行在php.ini文档中起作用。upload_tmp_dir是用来定义上传文件存放的临时路径,在这里你还可以给其定义一个绝对路径,例如:upload_tmp_dir = d:upload  当然,此时你的d:upload目录必须有读写权限。 
这里我设置为 
upload_tmp_dir = "c:\windows\temp\"

B
出现这样的错误语句一般是因为你的php.ini中关于session.save_path一项没有设置好,解决的方法是将session.save_path和session.cookie_path 设置置为 
session.save_path = "c:\windows\temp\" 
session.cookie_path = "c:\windows\temp\" 
(这个设置不知道是否正确.没试过.)
   也可以在c:\目录下建立一个temp目录,即可(前面我们的eaccelerarot正好用到,建立过这么一个文件夹)

PHP has encountered an Access Violation解决方法总结
这个问题不是很好处理,困惑了很多站长非常时间了
主要出现在windows主机的服务器上。
在php官方,http://bugs.php.net/
也能够查到两三千页的报告,他们官方也是束手无策,经过了11个小版本后,还是没有彻底解决
http://bugs.php.net/search.php?c ... ess&x=8&y=9

目前我提供一下这几年我维护经验,我的一些民间解决办法

本贴不断更新,请关注!!! 引用:
第一种可能:

去掉 php中 eaccelerator 的扩展
这样做能够解决您的问题,不过可能会加重系统负担
因为eaccelerator主要是为了节省系统资源的东西

具体做法是找到php.ini
如果是我帮您配置的,一般在c:/php/php.ini或者 c:/winnt/php.ini 或者c:/windows/php.ini

去掉

复制代码 代码如下:


zend_extension_ts="C:\php\extensions\eaccelerator_win_xxx.dll"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="c:\temp"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"


ea主要是在unix环境下开发的,但是作者忽略到windows实际上不像u主机那样,是没有u主机的那种内存共享机制的
这个bug已经提交给他们了,希望0.9.5能够解决

当然,如果您的机器这个问题不严重,建议还是保留,ea是一块非常优秀的Php缓存+加速软件
配合zo使用,将会降低系统负担 50%-80%左右,提高负载能力、速度和效率 200%左右引用:
第二种可能

session_save_path 需要设定一个实际的物理路径,并且该目录需要everyone的所有权限,类似U主机的0777引用:
第三种可能
c:/winnt/temp 或者 c:/windows/temp
也需要everyone的所有权限,类似U主机的0777引用:
第四种可能
您的内存严重不足,查看一下,如果有问题,请加内存,最好是一次加两条
比如加1G内存,最好是加2条一模一样的512M。否则没有启用双通道,效果也很一般引用:
第五种可能
ZendOptimizer和php的搭配不是很好
换个版本试试看
目前比较稳定的搭配是
php4.3.11+zo 2.5.10a
或者php4.4.1+zo 3.0 beta2引用:
第六种可能

这种多属于用win2003的用户
他们在应用池中设定了限制
比如多长时间回收,最大使用内存多少等等
这些设置势必造成这个经典的php错误
木头经过数以百计的测试,敢担保问题会出现在这里。引用:
第七种解决办法
2003用户,可以通过修改正在运行的应用池的, “性能”-“WEB园”“最大工作进程数”来解决.
曾经有个用户,直到加为10,才彻底解决了这个问题。

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1665
14
PHP Tutorial
1269
29
C# Tutorial
1249
24
How to adjust the wordpress article list How to adjust the wordpress article list Apr 20, 2025 am 10:48 AM

There are four ways to adjust the WordPress article list: use theme options, use plugins (such as Post Types Order, WP Post List, Boxy Stuff), use code (add settings in the functions.php file), or modify the WordPress database directly.

How to build a website for wordpress host How to build a website for wordpress host Apr 20, 2025 am 11:12 AM

To build a website using WordPress hosting, you need to: select a reliable hosting provider. Buy a domain name. Set up a WordPress hosting account. Select a topic. Add pages and articles. Install the plug-in. Customize your website. Publish your website.

The Compatibility of IIS and PHP: A Deep Dive The Compatibility of IIS and PHP: A Deep Dive Apr 22, 2025 am 12:01 AM

IIS and PHP are compatible and are implemented through FastCGI. 1.IIS forwards the .php file request to the FastCGI module through the configuration file. 2. The FastCGI module starts the PHP process to process requests to improve performance and stability. 3. In actual applications, you need to pay attention to configuration details, error debugging and performance optimization.

How to import the source code of wordpress How to import the source code of wordpress Apr 20, 2025 am 11:24 AM

Importing WordPress source code requires the following steps: Create a sub-theme for theme modification. Import the source code and overwrite the files in the sub-topic. Activate the sub-theme to make it effective. Test the changes to make sure everything works.

How to view the front-end of WordPress How to view the front-end of WordPress Apr 20, 2025 am 10:30 AM

You can view the WordPress front-end by logging into the dashboard and switching to the View Sites tab; automate the viewing process with a headless browser; installing the WordPress plugin to preview the front-end within the dashboard; viewing the front-end via a local URL (if WordPress is set locally).

What happens if session_start() is called multiple times? What happens if session_start() is called multiple times? Apr 25, 2025 am 12:06 AM

Multiple calls to session_start() will result in warning messages and possible data overwrites. 1) PHP will issue a warning, prompting that the session has been started. 2) It may cause unexpected overwriting of session data. 3) Use session_status() to check the session status to avoid repeated calls.

How to cancel the editing date of wordpress How to cancel the editing date of wordpress Apr 20, 2025 am 10:54 AM

WordPress editing dates can be canceled in three ways: 1. Install the Enable Post Date Disable plug-in; 2. Add code in the functions.php file; 3. Manually edit the post_modified column in the wp_posts table.

How to write a header of a wordpress How to write a header of a wordpress Apr 20, 2025 pm 12:09 PM

The steps to create a custom header in WordPress are as follows: Edit the theme file "header.php". Add your website name and description. Create a navigation menu. Add a search bar. Save changes and view your custom header.

See all articles