Problem 1: Report 500 error
Reason: lnmp has anti-cross-site settings
Details address: https://lnmp.org/faq/lnmp-vhost-add-howto.html
问题2:scandir() has been disabled for security reasons
Reason: LNMP 0.9 disables some dangerous PHP functions
PHP functions disabled in LNMP0.9 include: passthru, exec, system, chroot, scandir, chgrp, chown, shell_exec, proc_open, proc_get_status, ini_alter, ini_alter, ini_restore, dl, pfsockopen ,openlog, syslog, readlink, symlink, popepassthru, stream_socket_server , fsocket, fsockopen
Solution:
Edit the PHP configuration file in the lnmp environment:
-
vim /usr/local/php/etc/php.ini enters editing state
-
Enter /, enter search mode, find disable_functions
-
Look for the disable_functions string and delete the following scandir
Restart PHP to take effect
lnmp php-fpm restart