Record your environment
Run php -v and php -m in the same environment that will run the application. A command-line PHP installation can differ from the web-server runtime. Compare both with the application’s own requirements, including database driver and required extensions. Choose a supported release rather than blindly installing the newest branch.
Use an isolated project
Read the project’s installation instructions before running commands. Put dependencies and configuration in the documented locations, set the correct public document root and keep database credentials out of version control. The PHP built-in web server is a development tool, not a public production server.
Validate before launch
Create a separate test database and a non-production account. Exercise login, a write action, image upload and an invalid input. Remove temporary diagnostic pages, turn off public error display and test restoration of both files and database. Keep a note of the exact steps that worked.
php -v
php -m