The most common reason for а "500 server error" message, output by a PHP script, are incorrect file permissions. You need to make sure that the PHP script itself and every other file or directory on the account does not have world-writable permissions (666, 777).
On our servers, scripts are run with the username of their owner, and not with the user of the web server ("apache"). Thus, if a script has to write to a file/directory, world-writable permissions are not needed.
A file/directory with world-writable permissions is considered insecure, and cannot be used/executed.
All prices are in USD. No setup fees. Minimum contract period for hosting plans - 1 month. Full prepayment for the contract period. Money‑back guarantee: 15 days for accounts purchased for 1 month and 100 days for accounts on annual billing. Automatic renewal is optional. Fees for domain registrations and SSL certificates cannot be refunded in case of an early contract termination.