Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Henrykarn's avatar

problem with ftp in laravel 5.2 on php 7.1.7

In my Application on laravel 5.2 I'm using an ftp-Server using the folowing Statement:

Storage::disk('ftpmeta')->put($pathAndName, $logsatz);

In my Dev-Environment on php 5.6.3 it works fine.

Only when I deploy it on my Test-Server on php 7.1.7 my Application crashes whith Http 500.

The problem is exactly in the given Statement. If I comment out this line, no error occurs.

I have set up my Test-Server with php 7.1.7 because I want to upgrade the Application to Laravel 5.6 this year.

Are there any known issues with using flysystem-ftp on php 7.1.7?

0 likes
4 replies
lostdreamer_nl's avatar

Check your storage/logs/laravel.log to see what the actual error is. a 500 can be anything that goes wrong on the server's end.

I'm succesfully using flysystem sftp and ftp on laravel versions 5.2 and up on PHP 5.6 - 7.2

Henrykarn's avatar

I allready had checked laravel.log and it seemed, that nothing was written there, when the error occured. After reading your response I did some more tests and found out, that I had a problem in writing to the logfile on my Test-Server. So I deleted laravel.log and after that I didn't get http 500 any more. Instead the following error was reported:

ErrorException in FilesystemManager.php line 174:

Use of undefined constant FTP_BINARY - assumed 'FTP_BINARY'

Some more google-research told me, that this is a Problem with php 7 on windows. Seems, that the extension is not enabled by default in php.ini

Thank You for your help

GSherwin's avatar

I am getting this same error when I deployed to heroku. Did you ever resolve this? The code works as expected when local.

lostdreamer_nl's avatar

@gsherwin

As he said: "Some more google-research told me, that this is a Problem with php 7 on windows. Seems, that the extension is not enabled by default in php.ini"

in your php.ini there will be a line like:

# extension=ftp.so

uncomment that line (or add it if it wasnt there yet). The extension should already be on your server, just not pre setup in the php.ini file

Please or to participate in this conversation.