I installed a fresh copy of Symfony on my localhost at htdocs\symfony-fresh and the file structure is:
Now I run the following in git bash:
$ php bin/console server:run
then I was suggested to browse at 127.0.0.1:8000 to see the fresh installation of symfony. It works like a charm. But one day later I browse at 127.0.0.1:8000 and I can see the following error message:
This site can’t be reached
127.0.0.1 refused to connect.
It seems server is offline. I checked my apache & Mysql is running.
Then I tried to run the command again:
$ php bin/console server:run
But same problem is going on. I am new in Symfony and enjoying to learn, but this problem stuck me. What should I do to run this app browsing at 127.0.0.1/symfony-fresh or localhost/symfony-fresh?
You should check status follow:
php bin/console server:status
By default, the web server listens on port 8000 on the loopback device. You can change the socket passing an IP address and a port as a command-line argument:
# passing a specific IP and port
php bin/console server:start 192.168.0.1:8080
# or like this
php bin/console server:start *:8080
Apache has nothing to do with this, the built in Symfony server is based on php built in server (php -S ...)
The built in server is intended for development use only, you must run the command every time the server has stopped or the machine has rebooted.
If you want to use Symfony with apache you can setup a virtualhost: https://symfony.com/doc/current/setup/web_server_configuration.html
Related
I'am using Symfony and Laravel on same machine.
I'am on developement, and I have no webserver, I use the local server of each of them.
For Symfony, that works :
$ cd /var/www/symfony
$ php bin/console server:start
[OK] Server listening on http://127.0.0.1:8000
For Laravel, that does not work :
$ cd /var/www/laravel
$ php artisan serve
Laravel development server started: <http://127.0.0.1:8000>
[Thu Oct 12 21:46:21 2017] Failed to listen on 127.0.0.1:8000
When I stop the Symfony, then the Laravel works. There is a conflict between the 2 tools.
I am obliged to have the 2 working, because there is a REST-API on my Lavavel site and my symfony site is a client of this API.
How can I run the 2 sites with local development server, without installing a webserver ?
Your problem is that you can not share the same port on the same host.
I don't know Laravel, but I know Symfony. With Symfony you can change the port of the local server with this command :
php bin/console server:stop
php bin/console server:start 127.0.0.1:8080
After this command, you can try to restart your Laravel server, and you will have :
Symfony on url http://127.0.0.1:8080
Laravel on url http://127.0.0.1:8000
Use below command for run laravel project.
php artisan serve --port=8888
Using this command you can run laravel project in a different port.
I am using windows 10 and wamp server and I am fresh installing laravel and all i get is this error message and is it necessary to do php artisan serve everytime i open laravel ? as long as i close cmd prompt localhost:8000 refused to connect .
Php artisan serve error
I think you are running a Laravel project blog by command php artisan serve and you are browsing your application by localhost:8000 or 127.0.0.1:8000
Your screenshot saying that when you are trying to visit a url which is not defined in your routes/web.php then, you are getting invalid request (Unexpected EOF) error in your cmd.
And of course! in this case when you close cmd then your Laravel app will not run.
So now, if you don't want to run your Laravel app by the following command each time, then you can use Laragon in windows environment.
Either you have to run php aritsan serve or set up a virtual host in your OS. Here is how to set up a virtual host in Ubuntu 16.04: How To Set Up Apache Virtual Hosts on Ubuntu 16.04
This is case, you can keep your cmd open. And open another cmd, redirect to file path where you are working and it should work fine.
I have a PC with windows 8.1 and XAMPP v3.2.1 and it includes PHP 5.6.
I followed these steps from: http://symfony.com/doc/current/cookbook/web_server/built_in.html
php app/console server:run x.x.x.x:8000
The issue is, I can't run my symfony app in a web server, the error is:
Built in server terminated unexpectedly
If I launch this command: php app/console server:run, everything is ok:
Server running on http://127.0.0.1:8000
And this: php app/console server:run 0.0.0.0:8000 => OK
My application isn't accessible with my local IP address.
I almost sure you're defining an invalid IP address.
You must define or loopback address (localhost or 127.0.0.1) or your machine IP on local network (i.e: 192.168.25.7).
Also, if want more details on what is going on, run command passing "-vvv" (most verbose level):
$ bin/console -vvv server:run 192.168.25.6:8000
What is the procedure to install my app symfony 2.7 in ubuntu VPS with a domain for example www.myapp.com without a port
the documentarion is this:
$ cd my_project_name/
$ php app/console server:run
Then, open your browser and access the http://localhost:8000/app/example URL to see the Welcome page of Symfony:
but, they dont say nothing about how it is installed on a server such as apache for example, width a virtualhost
Please help!!
app/console server:run command for only development purpose
You need to configure web server for this
http://symfony.com/doc/current/cookbook/configuration/web_server_configuration.html
I have a jenkins build job of my symfony2 project that uses grunt to start the php built in webserver so that casperjs can run functional tests against it.
To start my webserver I'm using the following command:
php app/console server:start --router=" + __dirname + "/app/config/router_test.php --env=test 0.0.0.0:9001"
However the build fails with the following message:
A process is already listening on http://0.0.0.0:9001.
Thus I have SSHed to the jenkins box and run:
netstat -tln | grep 9001
Only to get no results?!
I have restarted the server and killed all php processes, disabled iptables however none of this seems to work.
This build used to work and in the last change, all that was added were more functional tests.
Has anyone got any ideas why this could be happening?
As commented, the fix that worked for me was to change the workspace directory. Seems to have been a permissions issue with the workspace folder that jenkins created yet a chmod 777 didn't resolve it hence the new workspace folder.