-
Install PHPBrew to manage multiple PHP versions
-
Install Docker
-
Install globally the library Argon2 used by PHP for password hashing. It must be installed globally because it's used to build PHP itself.
brew install argon2 -
Install with PHPBrew a version of PHP compatibly with Sylius (^7.2)
phpbrew install 7.4.16 +default +intl +pdo +mysql +gd +exif -- --with-password-argon2 -
Check that PHPBrew installated the version correctly and set it as the default PHP binary
phpbrew list phpbrew switch 7.4.16 -
Check that PHP 7.4.16 is working fine
php --version -
Modify the
php.iniwithphpbrew configchanging the following keysmemory_limit=2G date.timezone="Europe/Berlin" -
Create a Docker container to handle MySQL
docker run -p 3306:3306 --name sylius-course-db -e MYSQL_ROOT_PASSWORD=root -d mysql:5.7 -
Check that the container
sylius-course-dbis running finedocker psand check that you can reach the DB with Sequel Pro (for example)
host: 127.0.0.1 username: root password: root port: 3306 -
Install Symfony CLI
-
Create the Sylius project
composer create-project sylius/sylius-standard SyliusCourseN.B. If the installation fails because you're missing some PHP extension (e.g.
Install or enable PHP's gd extension), you can runphpbrew ext install <name of the extension> -
Change the database configuration inside the file
.envDATABASE_URL=mysql://root:[email protected]:3306/sylius_course_%kernel.environment% -
Install Sylius
cd SyliusCourse php bin/console sylius:installN.B. If you have an error with the PHP's extension
intl, then follow this Github's thread to install it correctly. -
Install the frontend dependencies and then build the assets
yarn install yarn run gulp -
Run the Symfony local server and enjoy!
symfony server:start open http://127.0.0.1:8000
-
Enable the Symfony plugin for the project going to
Languages & Frameworks -> PHP -> Symfony -> Enable Plugin for this Project -
Open
package.jsonand add this into thescriptsection:"symfony:start": "symfony server:start" -
Go into
Run/Debug configurationsand- add an npm action to run the script
symfony:start - add an npm action to run the script
watch - add a Compound action to run the two npm actions
- add an npm action to run the script
-
Go to
View -> Tool Windows -> Databaseto show the Database panel:- tap + symbol to add a MySQL database
- set
Host: localhost - set
User: root - set
Password: root - set
Port: 3306 - set
Database: sylius_course_dev