AddType application/x-httpd-php .php AddType application/x-httpd-">
The following configuration has been made in httpd.conf
LoadModule php_module "D:\php\php8apache2_4.dll"AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps PHPIniDir "D:/php"
Open the curl, mbstring, gd, openssl modules in php.ini, and use php -S
But if Apache is used to provide web services, phpinfo does not show that these modules are loaded.
Use the following code to test. Apache will display "No gd", which means that the gd function is not loaded.
function checkRequirements() { if (extension_loaded('gd')) { $gdInfo = gd_info(); if (!empty($gdInfo['FreeType Support'])) { echo "gd成功"; return 'gd'; } }else{ echo "没有gd"; } } checkRequirements();
The situation is the same when php8 is replaced by php7.4.
What is asking for help?
The reason is found. The extension_dir is not configured correctly in php.ini. The default ext must be changed to an absolute path. Otherwise, Apache will report that the loading is unsuccessful.