Home Backend Development PHP Tutorial php的error_log使用

php的error_log使用

Jun 23, 2016 pm 02:32 PM

apache+php 遇到php5ts.dll错误

这两天安装apache+php时遇到php5ts.dll错误问题。经过几天折腾,终于找到原因。
一、平台
操作系统:windows 2003;
Apache:2.2.17.0,使用httpd-2.2.17-win32-x86-openssl-0.9.8o.msi安装包;
PHP:5.3.5.0,采用apache模块方式,使用php-5.3.5-Win32-VC6-x86.msi安装包。
二、安装过程
将apache安装在D盘,安装后httpd.exe成功启动。安装php,选择apache模块方式,安装在D盘完成。PHP安装后,打开apache的httpd.conf文件,在文件尾部修正配置为:
PHPIniDir "d:/program files/php/"
LoadModule php5_module "d:/program files/php/php5apache2_2.dll"
三、错误
启动httpd时,出现错误。查看日志。apache的error.log中记录为:
[warn] pid file D:/Program Files/Apache Software Foundation/Apache2.2/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
Windows的事件查看器/应用程序中显示为:
Application Error中事件详细信息:错误应用程序httpd.exe,版本2.2.17.0,错误模块php5ts.dll,版本t5.3.5.0,错误地址0x000e890c。
上网查了一翻,涉及php5ts.dll错误的处理,一类是因为PHP只能使用自身版本的dll,如果出现因为系统路径变量的原因,导致其他版本的dll先行引用,则出现错误。针对此类错误,或是删除其他版本dll;或修改系统PATH变量,将PHP的放在前面;或将PHP的dll放到系统的System32目录下。不过,我的路径没有问题,PATH变量中PHP的安装目录还在System32前,也没有其他版本的php5ts.dll。前前后后试了多个安装版本,都无法解决问题。
四、最后解决
最后再次查看php.ini文件,发现一个配置:
error_log="C:\Windows\Temp\php-errors.log"。
于是打开C:\Windows\Temp\php-errors.log:
[14-Mar-2011 10:22:15] PHP Warning:  PHP Startup: Unable to load dynamic library 'D:\Program Files\PHP\ext\php_oci8.dll' - 找不到指定的模块。
  in Unknown on line 0
[14-Mar-2011 10:22:15] PHP Warning:  PHP Startup: Unable to load dynamic library 'D:\Program Files\PHP\ext\php_oci8_11g.dll' - 找不到指定的模块。
  in Unknown on line 0
[14-Mar-2011 10:22:15] PHP Warning:  PHP Startup: Unable to load dynamic library 'D:\Program Files\PHP\ext\php_pdo_oci.dll' - 找不到指定的模块。
  in Unknown on line 0
[14-Mar-2011 10:22:15] PHP Warning:  PHP Startup: Unable to load dynamic library 'D:\Program Files\PHP\ext\php_sybase_ct.dll' - 找不到指定的模块。
in Unknown on line 0
接下来,再次回到php.ini中,将上面4个模块注释掉:
[PHP_OCI8]
;extension=php_oci8.dll
[PHP_OCI8_11G]
;extension=php_oci8_11g.dll
[PHP_PDO_OCI]
;extension=php_pdo_oci.dll
[PHP_SYBASE_CT]
;extension=php_sybase_ct.dll
重新启动apache,成功。
五、小结
我安装PHP时,选择了完全安装。估计是完全安装也没有安装相关的dll模块,而php.ini中又引用这几个模块,从而导致httpd.exe启动时,引用php出错,而出错信息显示成php5ts.dll。因此,建议遇到php5ts.dll错误时,不妨查看一下php的error_log。

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 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
1662
14
PHP Tutorial
1262
29
C# Tutorial
1235
24
Explain different error types in PHP (Notice, Warning, Fatal Error, Parse Error). Explain different error types in PHP (Notice, Warning, Fatal Error, Parse Error). Apr 08, 2025 am 12:03 AM

There are four main error types in PHP: 1.Notice: the slightest, will not interrupt the program, such as accessing undefined variables; 2. Warning: serious than Notice, will not terminate the program, such as containing no files; 3. FatalError: the most serious, will terminate the program, such as calling no function; 4. ParseError: syntax error, will prevent the program from being executed, such as forgetting to add the end tag.

Explain secure password hashing in PHP (e.g., password_hash, password_verify). Why not use MD5 or SHA1? Explain secure password hashing in PHP (e.g., password_hash, password_verify). Why not use MD5 or SHA1? Apr 17, 2025 am 12:06 AM

In PHP, password_hash and password_verify functions should be used to implement secure password hashing, and MD5 or SHA1 should not be used. 1) password_hash generates a hash containing salt values ​​to enhance security. 2) Password_verify verify password and ensure security by comparing hash values. 3) MD5 and SHA1 are vulnerable and lack salt values, and are not suitable for modern password security.

PHP and Python: Comparing Two Popular Programming Languages PHP and Python: Comparing Two Popular Programming Languages Apr 14, 2025 am 12:13 AM

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP in Action: Real-World Examples and Applications PHP in Action: Real-World Examples and Applications Apr 14, 2025 am 12:19 AM

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

What are HTTP request methods (GET, POST, PUT, DELETE, etc.) and when should each be used? What are HTTP request methods (GET, POST, PUT, DELETE, etc.) and when should each be used? Apr 09, 2025 am 12:09 AM

HTTP request methods include GET, POST, PUT and DELETE, which are used to obtain, submit, update and delete resources respectively. 1. The GET method is used to obtain resources and is suitable for read operations. 2. The POST method is used to submit data and is often used to create new resources. 3. The PUT method is used to update resources and is suitable for complete updates. 4. The DELETE method is used to delete resources and is suitable for deletion operations.

PHP: A Key Language for Web Development PHP: A Key Language for Web Development Apr 13, 2025 am 12:08 AM

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

How does PHP handle file uploads securely? How does PHP handle file uploads securely? Apr 10, 2025 am 09:37 AM

PHP handles file uploads through the $\_FILES variable. The methods to ensure security include: 1. Check upload errors, 2. Verify file type and size, 3. Prevent file overwriting, 4. Move files to a permanent storage location.

Explain the difference between self::, parent::, and static:: in PHP OOP. Explain the difference between self::, parent::, and static:: in PHP OOP. Apr 09, 2025 am 12:04 AM

In PHPOOP, self:: refers to the current class, parent:: refers to the parent class, static:: is used for late static binding. 1.self:: is used for static method and constant calls, but does not support late static binding. 2.parent:: is used for subclasses to call parent class methods, and private methods cannot be accessed. 3.static:: supports late static binding, suitable for inheritance and polymorphism, but may affect the readability of the code.

See all articles