douzhe1264 2018-07-10 15:18
浏览 131

无法加载PHP扩展

I'm using Apache2.4 with php7 on Windows 2008 server.

Some extensions are enabled in php.ini enter image description here

If you run php -m you can see they are installed

enter image description here

But when I put this code into a .php file under apache/htdocs and access it via localhost/aaa.php

<?php
print_r(get_loaded_extensions());
?>

Those enabled extensions are not shown, the output is

Array ( [0] => Core 
        [1] => bcmath 
        [2] => calendar 
        [3] => ctype 
        [4] => date 
        [5] => filter 
        [6] => hash 
        [7] => iconv 
        [8] => json 
        [9] => SPL 
        [10] => pcre 
        [11] => readline 
        [12] => Reflection 
        [13] => session 
        [14] => standard 
        [15] => mysqlnd 
        [16] => tokenizer 
        [17] => zip 
        [18] => zlib 
        [19] => libxml 
        [20] => dom 
        [21] => PDO 
        [22] => Phar 
        [23] => SimpleXML 
        [24] => xml 
        [25] => wddx 
        [26] => xmlreader 
        [27] => xmlwriter 
        [28] => apache2handler 
    )

If I put this into a.php and access it via localhost, I can also see GD is not installed.

<?php if ( extension_loaded( 'gd' ) ): ?>
                    <li class="success">GD extension loaded.</li>
<?php else: $success = FALSE; ?>
                    <li class="fail">You do not have the GD PHP extension loaded.</li>
<?php endif; ?>

However, if I run php.exe a.php, the result says GD is loaded.

So seems runing via the apache server and local php executable return different results. Can anyone help with this?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
    • ¥15 个人网站被恶意大量访问,怎么办
    • ¥15 Vue3 大型图片数据拖动排序
    • ¥15 Centos / PETGEM
    • ¥15 划分vlan后不通了
    • ¥20 用雷电模拟器安装百达屋apk一直闪退
    • ¥15 算能科技20240506咨询(拒绝大模型回答)
    • ¥15 自适应 AR 模型 参数估计Matlab程序
    • ¥100 角动量包络面如何用MATLAB绘制
    • ¥15 merge函数占用内存过大