Installing CakePHP with Composer (Apache2 VirtualHost)

Hello,

I’m sorry, I speak a little English.

My /etc/apache2/sites-available/example.com.conf file:

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

It works:

a2ensite example.com.conf
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/example.com right now?

1 Like

1 folder in: /var/www/example.com

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

/var/www/example.com/webroot/index.html

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 https://getcomposer.org/installer
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/example.com