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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months 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)

Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Apr 05, 2025 am 12:04 AM

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

Explain the match expression (PHP 8 ) and how it differs from switch. Explain the match expression (PHP 8 ) and how it differs from switch. Apr 06, 2025 am 12:03 AM

In PHP8, match expressions are a new control structure that returns different results based on the value of the expression. 1) It is similar to a switch statement, but returns a value instead of an execution statement block. 2) The match expression is strictly compared (===), which improves security. 3) It avoids possible break omissions in switch statements and enhances the simplicity and readability of the code.

What is Cross-Site Request Forgery (CSRF) and how do you implement CSRF protection in PHP? What is Cross-Site Request Forgery (CSRF) and how do you implement CSRF protection in PHP? Apr 07, 2025 am 12:02 AM

In PHP, you can effectively prevent CSRF attacks by using unpredictable tokens. Specific methods include: 1. Generate and embed CSRF tokens in the form; 2. Verify the validity of the token when processing the request.

How can you prevent a class from being extended or a method from being overridden in PHP? (final keyword) How can you prevent a class from being extended or a method from being overridden in PHP? (final keyword) Apr 08, 2025 am 12:03 AM

In PHP, the final keyword is used to prevent classes from being inherited and methods being overwritten. 1) When marking the class as final, the class cannot be inherited. 2) When marking the method as final, the method cannot be rewritten by the subclass. Using final keywords ensures the stability and security of your code.

Describe the purpose and usage of the ... (splat) operator in PHP function arguments and array unpacking. Describe the purpose and usage of the ... (splat) operator in PHP function arguments and array unpacking. Apr 06, 2025 am 12:07 AM

The... (splat) operator in PHP is used to unpack function parameters and arrays, improving code simplicity and efficiency. 1) Function parameter unpacking: Pass the array element as a parameter to the function. 2) Array unpacking: Unpack an array into another array or as a function parameter.

Explain strict types (declare(strict_types=1);) in PHP. Explain strict types (declare(strict_types=1);) in PHP. Apr 07, 2025 am 12:05 AM

Strict types in PHP are enabled by adding declare(strict_types=1); at the top of the file. 1) It forces type checking of function parameters and return values ​​to prevent implicit type conversion. 2) Using strict types can improve the reliability and predictability of the code, reduce bugs, and improve maintainability and readability.

Unable to log in to mysql as root Unable to log in to mysql as root Apr 08, 2025 pm 04:54 PM

The main reasons why you cannot log in to MySQL as root are permission problems, configuration file errors, password inconsistent, socket file problems, or firewall interception. The solution includes: check whether the bind-address parameter in the configuration file is configured correctly. Check whether the root user permissions have been modified or deleted and reset. Verify that the password is accurate, including case and special characters. Check socket file permission settings and paths. Check that the firewall blocks connections to the MySQL server.

What is a composer used for? What is a composer used for? Apr 06, 2025 am 12:02 AM

Composer is a dependency management tool for PHP. The core steps of using Composer include: 1) Declare dependencies in composer.json, such as "stripe/stripe-php":"^7.0"; 2) Run composerinstall to download and configure dependencies; 3) Manage versions and autoloads through composer.lock and autoload.php. Composer simplifies dependency management and improves project efficiency and maintainability.

See all articles