I own and operate a racing game. I did not create the game; however, the code is 11 years ago with no major changes done. The site has now become extremely unstable and Cron Jobs stopped working.
I reached out to my web host and he explained and instructed me to do the following:
The instability you're experiencing all seems to be due to the site being very messy with include paths. Full paths are (or were) all over the place. When I'm building PHP, I usually build an auto-loader (if / when I'm unable to use a framework that does that for me). The autoloader would then include all classes necessary to execute a page, from one single, central location.
But, that assumes all your includes are classes. Since this is not the case with GTRacer, I would probably follow these steps:
1) (very short term) Introduce a global variable that contains the root path of the website, and perhaps additional important paths you might include code from. Then, in every PHP file, make sure each and every include and require uses this root-path-variable.
2) (short term) Make sure database credentials and other private things are located outside of the public web root. There is a special directory (called "private") for exactly this purpose.
3) (longer term) Rework the code into something a bit more OOP. At the very least encapsulate all code into classes (even if it were only a class per page, or part of a page) so that you can auto-load I would also take a good hard look into making stuff reusable and I'd also see if I could separate logic and page-layout.
I would like to achieve all 3 items on the list above, if possible. The attached screenshots show the other errors that I am experiencing.
Thank you for your time.