What are some common issues that can cause a PHP script to work on a server but not locally, specifically related to file uploads?

One common issue that can cause a PHP script to work on a server but not locally when dealing with file uploads is the difference in file paths. When uploading files, the file path may be different on the server compared to your local machine. To solve this issue, you can use the `$_SERVER['DOCUMENT_ROOT']` superglobal variable to get the root directory of your server, which will work both locally and on the server.

$uploadDir = $_SERVER['DOCUMENT_ROOT'] . '/uploads/';