После того, как я построил этот код, я столкнулся с проблемами, совершенно не связанными с этим, и переехал на новый сервер.Используя тот же код и те же системы (я установил LAMP на Fedora 29 после проблем с Ubuntu 18.04).
Может быть больше проблем, чем я знаю, так как мне никогда не удавалось все проверить, но детали, которые раньше работали, больше не работают.
Запуск PHP 7.2.15 на моем сервере fedora 29.
При загрузке файла через мой веб-сайт он действовал так, как будто завершал загрузку.После нахождения журнала ошибок он указал на следующее:
Ошибка была: [16-Feb-2019 07:05:10 UTC] Предупреждение PHP:
move_uploaded_file (../ uploads / Photos / 2.jpg): не удалось открыть поток: в файле /var/www/html/scripts/upload2.5.php отказано в доступе в строке 99
Журнал ошибок:
[16-Feb-2019 06:20:22 UTC] PHP Notice: Undefined index: fileToUpload in
/var/www/html/scripts/upload2.5.php on line 12
[16-Feb-2019 06:20:22 UTC] PHP Notice: Undefined index: fileToUpload in
/var/www/html/scripts/upload2.5.php on line 20
[16-Feb-2019 06:20:22 UTC] PHP Notice: Undefined index: fileToUpload in
/var/www/html/scripts/upload2.5.php on line 31
[16-Feb-2019 06:21:36 UTC] PHP Warning:
move_uploaded_file(../uploads/Unsortedmixin_implementation_report.txt):
failed to open stream: Permission denied in
/var/www/html/scripts/upload2.5.php on line 132
[16-Feb-2019 06:21:36 UTC] PHP Warning: move_uploaded_file(): Unable to
move '/tmp/phpQQrBlj' to
'../uploads/Unsortedmixin_implementation_report.txt' in
/var/www/html/scripts/upload2.5.php on line 132
[16-Feb-2019 06:23:14 UTC] PHP Warning: POST Content-Length of 22843605
bytes exceeds the limit of 8388608 bytes in Unknown on line 0
[16-Feb-2019 06:23:14 UTC] PHP Notice: Undefined index: fileToUpload in
/var/www/html/scripts/upload2.5.php on line 12
[16-Feb-2019 06:23:14 UTC] PHP Notice: Undefined index: fileToUpload in
/var/www/html/scripts/upload2.5.php on line 20
[16-Feb-2019 06:23:14 UTC] PHP Notice: Undefined index: fileToUpload in
/var/www/html/scripts/upload2.5.php on line 31
[16-Feb-2019 06:26:13 UTC] PHP Warning:
move_uploaded_file(../uploads/Photos/2.jpg): failed to open stream:
Permission denied in /var/www/html/scripts/upload2.5.php on line 99
[16-Feb-2019 06:26:13 UTC] PHP Warning: move_uploaded_file(): Unable to
move '/tmp/phpwHHrHu' to '../uploads/Photos/2.jpg' in
/var/www/html/scripts/upload2.5.php on line 99
[16-Feb-2019 06:27:31 UTC] PHP Warning:
move_uploaded_file(../uploads/Photos/2.jpg): failed to open stream:
Permission denied in /var/www/html/scripts/upload2.5.php on line 99
[16-Feb-2019 06:27:31 UTC] PHP Warning: move_uploaded_file(): Unable to
move '/tmp/phpI4mr5w' to '../uploads/Photos/2.jpg' in
/var/www/html/scripts/upload2.5.php on line 99
[16-Feb-2019 06:36:09 UTC] PHP Warning:
move_uploaded_file(../uploads/Photos/2.jpg): failed to open stream:
Permission denied in /var/www/html/scripts/upload2.5.php on line 99
[16-Feb-2019 06:36:09 UTC] PHP Warning: move_uploaded_file(): Unable to
move '/tmp/phpw5vyRB' to '../uploads/Photos/2.jpg' in
/var/www/html/scripts/upload2.5.php on line 99
[16-Feb-2019 06:53:22 UTC] PHP Warning:
move_uploaded_file(../uploads/Photos/2.jpg): failed to open stream:
Permission denied in /var/www/html/scripts/upload2.5.php on line 99
[16-Feb-2019 06:53:22 UTC] PHP Warning: move_uploaded_file(): Unable to
move '/tmp/phpXQIpKm' to '../uploads/Photos/2.jpg' in
/var/www/html/scripts/upload2.5.php on line 99
[16-Feb-2019 07:05:10 UTC] PHP Warning:
move_uploaded_file(../uploads/Photos/2.jpg): failed to open stream:
Permission denied in /var/www/html/scripts/upload2.5.php on line 99
[16-Feb-2019 07:05:10 UTC] PHP Warning: move_uploaded_file(): Unable to
move '/tmp/phpUS5Izg' to '../uploads/Photos/2.jpg' in
/var/www/html/scripts/upload2.5.php on line 99
[16-Feb-2019 07:07:33 UTC] PHP Warning:
move_uploaded_file(../uploads/Photos/2.jpg): failed to open stream:
Permission denied in /var/www/html/scripts/upload2.5.php on line 99
[16-Feb-2019 07:07:33 UTC] PHP Warning: move_uploaded_file(): Unable to
move '/tmp/phpNEl1wC' to '../uploads/Photos/2.jpg' in
/var/www/html/scripts/upload2.5.php on line 99
[16-Feb-2019 07:08:12 UTC] PHP Warning: POST Content-Length of 22843605
bytes exceeds the limit of 8388608 bytes in Unknown on line 0
[16-Feb-2019 07:08:12 UTC] PHP Notice: Undefined index: fileToUpload in
/var/www/html/scripts/upload2.5.php on line 12
[16-Feb-2019 07:08:12 UTC] PHP Notice: Undefined index: fileToUpload in
/var/www/html/scripts/upload2.5.php on line 20
[16-Feb-2019 07:08:12 UTC] PHP Notice: Undefined index: fileToUpload in
/var/www/html/scripts/upload2.5.php on line 31
[16-Feb-2019 07:29:36 UTC] PHP Warning: POST Content-Length of 22843605
bytes exceeds the limit of 1024 bytes in Unknown on line 0
[16-Feb-2019 07:29:36 UTC] PHP Notice: Undefined index: fileToUpload in
/var/www/html/scripts/upload2.5.php on line 12
[16-Feb-2019 07:29:36 UTC] PHP Notice: Undefined index: fileToUpload in
/var/www/html/scripts/upload2.5.php on line 20
[16-Feb-2019 07:29:36 UTC] PHP Notice: Undefined index: fileToUpload in
/var/www/html/scripts/upload2.5.php on line 31
[16-Feb-2019 07:42:16 UTC] PHP Warning: POST Content-Length of 478786 bytes
exceeds the limit of 1024 bytes in Unknown on line 0
[16-Feb-2019 07:42:16 UTC] PHP Notice: Undefined index: fileToUpload in
/var/www/html/scripts/upload2.5.php on line 12
[16-Feb-2019 07:42:16 UTC] PHP Notice: Undefined index: fileToUpload in
/var/www/html/scripts/upload2.5.php on line 20