Home > Backend Development > PHP Tutorial > PHP报错Fatal error: Class 'COM' not found in怎么解决?

PHP报错Fatal error: Class 'COM' not found in怎么解决?

PHPz
Release: 2020-06-28 09:25:54
Original
4525 people have browsed it

PHP报错Fatal error: Class 'COM' not found in怎么解决?

PHP:Fatal error: Class 'COM' not found in … 的解决办法

1、在windows的“服务”里面检查COM 服务是否已经启动。如果未启动,请启动它

2、检查php目录ext文件夹下面php_com_dotnet.dll是否存在

3、在php.ini里面加入以下语句:

[PHP_COM_DOTNET]
extension=php_com_dotnet.dll
Copy after login

如图所示:

1.jpg

4、php.ini中设置

com.allow_dcom = true
Copy after login

说明:

PHP 5.4.5以前的版本,只需要在php.ini中把com.allow_dcom = true打开就可以了,但是5.4.5版本以后,PHP把com/dotnet 模块集成到了一个单独的扩展中,所以需要在php.ini中加一行扩展extension=php_com_dotnet.dll,是加一行,不是打开,默认配置文件中没有这一行的,然后重启IIS或Apache,再次运行就正常了!

更多相关知识,请访问 PHP中文网!!

Related labels:
php
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template