ilernet
ilernet

Reputation: 236

How to load the symfony server when logging in

I am using linux and every time I start the session I must put this command to start the symfony server

php bin/console server:start

Can you think of a way to automate this process?

Thank you

Upvotes: 0

Views: 150

Answers (3)

Nightfox
Nightfox

Reputation: 488

If you are using apache and Linux there will be a folder /var/www/html/. Place your code in the folder and call the project directly from the browser as localhost/project_name/web/app_dev.php . Or as @Aleem says, set up a virtual host in your system. Edit : On xampp, I think the folder is htdocs or something.

Upvotes: 1

Aleem
Aleem

Reputation: 161

I think the best way to do this would be to get rid of the server:start command and setup a virtual host. Once you setup a virtual host, you should be able to access the website with the url you define. Something like http://yousite.local. If you are not sure on how to create virtual hosts. The following articles helps you.

  1. How to setup virtual hosts on Apache
  2. Symfony web server configuration

Hope this helps.

Upvotes: 1

Elyass
Elyass

Reputation: 726

One solution is to write a script that launch the server and place this script in /etc/profile.d

/etc/profile.d/your_script.sh

Exemple for the script.sh

cd /path/to/your/symfony/project;
php bin/console server:start

More info

https://help.ubuntu.com/community/EnvironmentVariables#A.2Fetc.2Fprofile.d.2F.2A.sh

Upvotes: 1

Related Questions