What could be causing issues with an upload script when moving it to a new server in PHP?

The issue could be related to file permissions on the new server. Make sure that the directory where the files are being uploaded has the correct permissions for the web server to write to it. Additionally, check if the PHP configuration on the new server allows file uploads and the maximum file size is set appropriately.

// Set correct permissions for the upload directory
chmod('/path/to/upload/directory', 0777);

// Check PHP configuration for file upload settings
echo ini_get('upload_max_filesize');
echo ini_get('post_max_size');