Setting up a Test Server – Part 02/??

Alright, I took some time off work, and after a good solid day of doing nothing, I’m pleased to report I was able to tear myself away from Empyrion – Galactic Survival in order to do some dev-work. I’ve also managed to keep my Black Forest commitment low enough to not be an issue (10+ games, not a good idea).

Anyways, when we last left off I’d just discovered that you have to let Apache2 know that PHP is a thing. So we did that. Keep in mind, that this server started with Ubuntu–thats it. No PHP, Apache2, PostgreSQL, nothing.

Going back to that wonderful file, “localhost/web/config.php” I can see that I’ve got a few new errors, that are thankfully, more descriptive.

Vendor libraries are missing. Install composer following instructions from Then run “php composer.phar install” to install them.

Change the permissions of either “app/cache/” or “var/cache/” directory so that the web server can write into it.

Change the permissions of either “app/logs/” or “var/logs/” directory so that the web server can write into it.

Set the “date.timezone” setting in php.ini* (like Europe/Paris).

Haha! An error that tells me how to fix it. And not just one, but FOUR! Sugoi~! That first one is pretty straightforward. Go to the website, follow the getting started instructions.

As for the permissions, well, this is a local test server, something that won’t be accessible from the internet , so I’m not particularly concerned what the permissions are so long as they work. Given that, we’re going to do this wonderful command:

sudo chmod 777 -R /var/cache/

Followed by . . .

sudo chmod 777 -R /var/logs/

Wait a minute… That directory doesn’t exist. Uh oh.

sudo mkdir /var/logs/
sudo chmod 777 -R /var/logs/

Alright, so, theoretically we’ve gotten that done. Onwards, back to config.php. Which has updated absolutely nothing. What’s going on?

It looks like it still thinks I don’t have that composer file. Well then! I can play that game.

sudo cp /home/PATH/composer.json /var/www/html/

Replace PATH with whatever your username is, of course, and then type the following:

cd /var/www/html/
php composer.phar install

Which will then sit there for a couple minutes, and probably give you a bunch of errors. To fix those, we’re going to type the following:

sudo apt-get install php-curl

We still have a few issues to solve though, like that timezone bit. To get at that lets do the following–it should be noted that I’ve a GUI setup and am using a CLI to type these from there (I’m lazy and like pretty colors :P):

cd  /etc/php/7.0/apache2/
sudo gedit php.ini

From there, there’s a number of things you can edit, like the amount of memory a string is allowed to use (I’ve a lot of memory on hand, so I upped that a bit), but the main thing we’re after is:

; date.timezone =

Which we’re going to change that line to:

date.timezone = Europe/Berlin

Which will make our website think it’s in Berlin’s timezone (which could be handy down the line for bug testing and log comparisons n such or something). Do note the missing semi-colon. That was intentional, we want php to use that line.

This entry is already getting long, so I’m going to cut it short here and move on to #3.