Installing CakePHP with Composer (Apache2 VirtualHost)


I’m sorry, I speak a little English.

My /etc/apache2/sites-available/ file:

<VirtualHost *:80>
	DocumentRoot /var/www/
	AddType application/x-httpd-php .php
	<Directory "/var/www/">
		Options FollowSymLinks
		AllowOverride All
		Order Allow,Deny
		Allow from all

It works:

a2enmod rewrite
systemctl reload apache2

How can I install CakePHP? I haven’t used a Composer yet. I’m using Debian and Apache2.

I’m a beginner. Please help me.

What, if anything, is in /var/www/ right now?

1 Like

1 folder in: /var/www/

The folder name webroot and only have 1 index.html file:


Only 1 line this file for testing.

Have you tried following the installation instructions? If so, what problem did you encounter with that process? (If not, why not?)

1 Like

Solved. This is my first time with Composer.

wget -O composer-setup.php
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
sudo composer self-update
rm composer-setup.php
composer create-project --prefer-dist cakephp/app:~4.3 /var/www/