I recently started looking into what it takes to get PHP running on Glitch. None of the existing starter projects fulfilled all my expectations, so I decided to make one myself.
The projects is set up as a LAMP version of hello-sqlite. It also has a lot of comments in hopes that it can be used even if you are only a beginner at PHP.
Some noteable changes, compared to the lamp-poc project, are:
- DocumentRoot (i.e. the folder where files are served from) is set to a specific folder instead of the app root. This makes it easier to control what files can be publicly accessed.
- Apache logs are saved to the
.data
folder instead of the.apache2/log
folder. This prevents them from being remixed and potentially leaking sensitive information. - Apache access logs have the correct IP instead of all logging as
127.0.0.1
- Accessing a folder without trailing slash will no longer append port 3000.
- The error
httpd (pid X) already running
should be fixed. - Several small security improvements.
Since lamp-poc was only a proof of concept there are of cause many more additions. These were just same of the most needed changes, in my opinion.