search

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
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
What is the best way to send an email using PHP?What is the best way to send an email using PHP?May 08, 2025 am 12:21 AM

ThebestapproachforsendingemailsinPHPisusingthePHPMailerlibraryduetoitsreliability,featurerichness,andeaseofuse.PHPMailersupportsSMTP,providesdetailederrorhandling,allowssendingHTMLandplaintextemails,supportsattachments,andenhancessecurity.Foroptimalu

Best Practices for Dependency Injection in PHPBest Practices for Dependency Injection in PHPMay 08, 2025 am 12:21 AM

The reason for using Dependency Injection (DI) is that it promotes loose coupling, testability, and maintainability of the code. 1) Use constructor to inject dependencies, 2) Avoid using service locators, 3) Use dependency injection containers to manage dependencies, 4) Improve testability through injecting dependencies, 5) Avoid over-injection dependencies, 6) Consider the impact of DI on performance.

PHP performance tuning tips and tricksPHP performance tuning tips and tricksMay 08, 2025 am 12:20 AM

PHPperformancetuningiscrucialbecauseitenhancesspeedandefficiency,whicharevitalforwebapplications.1)CachingwithAPCureducesdatabaseloadandimprovesresponsetimes.2)Optimizingdatabasequeriesbyselectingnecessarycolumnsandusingindexingspeedsupdataretrieval.

PHP Email Security: Best Practices for Sending EmailsPHP Email Security: Best Practices for Sending EmailsMay 08, 2025 am 12:16 AM

ThebestpracticesforsendingemailssecurelyinPHPinclude:1)UsingsecureconfigurationswithSMTPandSTARTTLSencryption,2)Validatingandsanitizinginputstopreventinjectionattacks,3)EncryptingsensitivedatawithinemailsusingOpenSSL,4)Properlyhandlingemailheaderstoa

How do you optimize PHP applications for performance?How do you optimize PHP applications for performance?May 08, 2025 am 12:08 AM

TooptimizePHPapplicationsforperformance,usecaching,databaseoptimization,opcodecaching,andserverconfiguration.1)ImplementcachingwithAPCutoreducedatafetchtimes.2)Optimizedatabasesbyindexing,balancingreadandwriteoperations.3)EnableOPcachetoavoidrecompil

What is dependency injection in PHP?What is dependency injection in PHP?May 07, 2025 pm 03:09 PM

DependencyinjectioninPHPisadesignpatternthatenhancesflexibility,testability,andmaintainabilitybyprovidingexternaldependenciestoclasses.Itallowsforloosecoupling,easiertestingthroughmocking,andmodulardesign,butrequirescarefulstructuringtoavoidover-inje

Best PHP Performance Optimization TechniquesBest PHP Performance Optimization TechniquesMay 07, 2025 pm 03:05 PM

PHP performance optimization can be achieved through the following steps: 1) use require_once or include_once on the top of the script to reduce the number of file loads; 2) use preprocessing statements and batch processing to reduce the number of database queries; 3) configure OPcache for opcode cache; 4) enable and configure PHP-FPM optimization process management; 5) use CDN to distribute static resources; 6) use Xdebug or Blackfire for code performance analysis; 7) select efficient data structures such as arrays; 8) write modular code for optimization execution.

PHP Performance Optimization: Using Opcode CachingPHP Performance Optimization: Using Opcode CachingMay 07, 2025 pm 02:49 PM

OpcodecachingsignificantlyimprovesPHPperformancebycachingcompiledcode,reducingserverloadandresponsetimes.1)ItstorescompiledPHPcodeinmemory,bypassingparsingandcompiling.2)UseOPcachebysettingparametersinphp.ini,likememoryconsumptionandscriptlimits.3)Ad

See all articles

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

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft