Php cannot be modified because it is a virtual space. INI file: use ftp to upload a large video file to the remote server. The script is as follows: {code ...} the script can be uploaded to the remote server on the local server, but it cannot be uploaded to the remote server. The php. ini file cannot be modified because it is a virtual space. You can use ftp to upload large video files to the remote server. The script is as follows:
$ Ftp_server = "xxxx.xxxx.com"; $ ftp_user_name = "user"; $ ftp_user_pass = "pass"; $ local_file = "D:/Lyb_0/zmsgx.mp4 "; // local file $ server_file = "htdocs/videos/zmsgx.mp4"; // path of the file to be uploaded $ conn_id = ftp_connect ($ ftp_server ); // connect FTP $ login_result = ftp_login ($ conn_id, $ ftp_user_name, $ ftp_user_pass) or die ("Login error"); // Login $ fp = fopen ($ local_file, "r"); ftp_pasv ($ conn_id, true); // enable passive mode transmission // upload parameter if (ftp_fput ($ conn_id, $ server_file, $ fp, FTP_BINARY )) {echo "Successfully uploaded $ server_file \ n";} else {echo "There was a problem while uploading $ file \ n";} // close the connection ftp_close ($ conn_id ); fclose ($ fp );
The script can be uploaded to the remote server on the local server, but it cannot be uploaded to the remote server.
Reply content:
The php. ini file cannot be modified because it is a virtual space. You can use ftp to upload large video files to the remote server. The script is as follows:
$ Ftp_server = "xxxx.xxxx.com"; $ ftp_user_name = "user"; $ ftp_user_pass = "pass"; $ local_file = "D:/Lyb_0/zmsgx.mp4 "; // local file $ server_file = "htdocs/videos/zmsgx.mp4"; // path of the file to be uploaded $ conn_id = ftp_connect ($ ftp_server ); // connect FTP $ login_result = ftp_login ($ conn_id, $ ftp_user_name, $ ftp_user_pass) or die ("Login error"); // Login $ fp = fopen ($ local_file, "r"); ftp_pasv ($ conn_id, true); // enable passive mode transmission // upload parameter if (ftp_fput ($ conn_id, $ server_file, $ fp, FTP_BINARY )) {echo "Successfully uploaded $ server_file \ n";} else {echo "There was a problem while uploading $ file \ n";} // close the connection ftp_close ($ conn_id ); fclose ($ fp );
The script can be uploaded to the remote server on the local server, but it cannot be uploaded to the remote server.