如何在Sylius中运行生产环境?
How to run production environment in Sylius?
我想知道 运行 sylius 初始版本的 prod env 是否必须遵循相同的步骤 运行 1.5 和 1.6 版本的生产环境。如果没有,有人可以确切地告诉我实现它的步骤是什么吗?我将非常感谢您的帮助。
我找到了一些关于生产环境的信息,here。它是关于 运行在 Sylius 的初始版本上生成环境。
After doing some searching and researching I've got it!!!
===== On Ubuntu WSL under Windows 10 ver.1903 (build 18362. 356) =====
Running sylius project in prod. env. (Sylius 1.5.1/symfony 4.2.9/php 7.2.19/Apache 2.4.41)
------------------------------------------------------------------------------------------
If your sylius project was installed at /home/your_username/your_sylius_project
1. Open Ubuntu WSL console and run:
sudo gedit /home/your_username/your_sylius_project/.env
note: you could use Windows' atom as well to edit the file.
2. Edit .env file by commenting the following 3 lines:
#APP_ENV=dev
#APP_DEBUG=1
#APP_SECRET=EDITME
3. Add these new 3 lines
APP_ENV=prod
APP_DEBUG=0
APP_SECRET=EDITMEXYZ
4. Close gedit and then run:
symfony serve
[running symfony server][1]
[1]: https://i.stack.imgur.com/c3NaA.jpg
5. Open browser
127.0.0.1:8000 -->frontend
127.0.0.1:8000/admin/login -->backend
everything seems to be working nice!!!
Some notes
----------
1. I did migrate my sylius project from a Windows directory to another one,
located in the Ubuntu WSL directory, and had some read file permissions issues, so
I did run:
sudo chmod -R 757 /home/your_username/your_sylius_project/
2. In case you get some trouble with file reading permissions while trying to
run "yarn install", run the following:
sudo chmod -R 777 /home/your_username/.yarn/
3. Change file permissions to /var/cache/ and var/log/ directories.
run the following:
sudo chmod -R 777 /home/your_username/your_sylius_project/var/cache/
sudo chmod -R 777 /home/your_username/your_sylius_project/var/log/
4. I had some read file permission with /home/your_username/.symfony/php/
directory, so I did run:
sudo chmod -R 777 /home/your_username/.symfony/php/
我想知道 运行 sylius 初始版本的 prod env 是否必须遵循相同的步骤 运行 1.5 和 1.6 版本的生产环境。如果没有,有人可以确切地告诉我实现它的步骤是什么吗?我将非常感谢您的帮助。
我找到了一些关于生产环境的信息,here。它是关于 运行在 Sylius 的初始版本上生成环境。
After doing some searching and researching I've got it!!!
===== On Ubuntu WSL under Windows 10 ver.1903 (build 18362. 356) =====
Running sylius project in prod. env. (Sylius 1.5.1/symfony 4.2.9/php 7.2.19/Apache 2.4.41)
------------------------------------------------------------------------------------------
If your sylius project was installed at /home/your_username/your_sylius_project
1. Open Ubuntu WSL console and run:
sudo gedit /home/your_username/your_sylius_project/.env
note: you could use Windows' atom as well to edit the file.
2. Edit .env file by commenting the following 3 lines:
#APP_ENV=dev
#APP_DEBUG=1
#APP_SECRET=EDITME
3. Add these new 3 lines
APP_ENV=prod
APP_DEBUG=0
APP_SECRET=EDITMEXYZ
4. Close gedit and then run:
symfony serve
[running symfony server][1]
[1]: https://i.stack.imgur.com/c3NaA.jpg
5. Open browser
127.0.0.1:8000 -->frontend
127.0.0.1:8000/admin/login -->backend
everything seems to be working nice!!!
Some notes
----------
1. I did migrate my sylius project from a Windows directory to another one,
located in the Ubuntu WSL directory, and had some read file permissions issues, so
I did run:
sudo chmod -R 757 /home/your_username/your_sylius_project/
2. In case you get some trouble with file reading permissions while trying to
run "yarn install", run the following:
sudo chmod -R 777 /home/your_username/.yarn/
3. Change file permissions to /var/cache/ and var/log/ directories.
run the following:
sudo chmod -R 777 /home/your_username/your_sylius_project/var/cache/
sudo chmod -R 777 /home/your_username/your_sylius_project/var/log/
4. I had some read file permission with /home/your_username/.symfony/php/
directory, so I did run:
sudo chmod -R 777 /home/your_username/.symfony/php/