I have a PHP web server powered by Nginx,HHVM and Lumen, when I start the server using this command : php artisan serv --port="8081" --host"x.x.x.x"
it will start and running perfectly for a while like two weeks max!
then it will die and not responding anything! It's not on heavy load of requests. I don't know if it's HHVM related issues or Lumen problem?!
php artisan serve is the development way of things. when you start your affirmation and say that you have a NGINX server and then say that you are using the dev server build in Laravel it's way to wrong. You need to configure NGINX to serve the Lumen app with it (example of linux server, nginx and lumen). I hope the example will clear your vision on this situation.
Related
I'm using this library to add websockets to my codeigniter app. I got everything to work, but I need the websocket server to always run in the background, regardless of the CLI being open or not.
To run the server in the CLI, I run this command:
php index.php welcome index
Which gives me:
Running server on host 0.0.0.0:8282
Authentication activated
Websockets works on my app, but if I close the CLI, the server closes as well. How do I keep this running? I have Supervisor (as suggested for Ratchet), but I have no idea where to go from here. I'm just running a simple PHP server (Ubuntu on AWS Lightsail), not a node one, bytheway.
Hi my CakePHP project works fine. I have pushed it to my server #www.zeyeland.com/register. So the cake app works great but I am not sure how to get my Apache2 server to run the app automatically. I have to log into my server and type bin/cake server to start it.
Some time ago, When I uploaded my NodeJS app to server I had to edit the .bashrc file and use the bash script command "cd/var/www/html/zeyeland-website/bin && pm2 start npm1 -- start and cd". This command starts my nodejs app automatically
Do I need a similar bash command with bin/cake server to run my Cakephp project automatically too?
You need to look for upstarting apache and mysql so that whenever your server reboots the services will start automatically.
Look for upstart at
https://www.digitalocean.com/community/tutorials/how-to-configure-a-linux-service-to-start-automatically-after-a-crash-or-reboot-part-1-practical-examples
I used to think that the internal web server which SYMFONY uses is part of APACHE server, which runs with the following command:
$ php bin/console server:start
But as I turn off the Apache server on my PC (windows 10) the internal web server still producing without any problems, so is it that the internal web server has nothing to do with the Apache server or it's something unusual?
PHP provides a standalone built-in web server.
You can try it by running php -S localhost:3000 -t web at the root directory of your project then browsing http://localhost:3000/app_dev.php.
All commands that are part of the server:* namespace are related to the PHP built-in server.
For more informations, look at the command directly.
it is using PHP build in server
I'm learning laravel, and at the beginning I had run the command
php artisan serve
and keep my terminal window open so I can keep the server running, but later I wanted to just work with my app just like working on a normal php application so I created a virtual host directed to my laravel application "public" folder.
here is the problem:
I still have to run the "php artisan serve" and open my virtual server url
http://brk.localhost:8000
and then close the terminal, all that before I can normally open this link without defining the port number 8000.
and If I left my computer and get back to continue work, I found that I can't access it unless I do the whole process again.
and If I made a modification to any of the application views I get the same problem.
what am I missing?
Just add the and symbol '&' to the end of the command. This will keep it running in the background.
There are 3 main ways that you can access your Laravel app while you are developing it.
1) Using artisan serve
This method is probably the easiest method but it does mean that you have to remember to do this every time you start working on your project, which you have said that you do not want to do.
2) Using Laravel Homestead
This method requires a little more configuration but the documentation is very good. You won't have to remember to keep the terminal window open when you use it, but you'll still have to remember to keep the virtual machine running.
3) Set up LAMP / MAMP / WAMP or even LEMP
Setting up a local Apache or Nginx daemon on your own machine will require the most amount of configuration but it will mean that your web server automatically starts with your OS so whatever you put in your web directory will always be accessible through the web browser. You will not need to run and terminal commands or run a virtual machine.
Please note, however, that by using a local Apache/Nginx daemon you will be sacrificing a lot of flexibly and you will not have the luxury of deleting it all and starting again in a few minutes if you mess up the config.
Still, a lot of people still prefer to run their own Apache/Nginx daemon locally for development. I am one of them.
I encountered a similar situation where, if I were to save any modification to project files, I had to run "php artisan serve" and quit it before apache2 can serve the site.
I fixed it by modifying the file system permissions for my project.
I found this , which fixed the permission issue.
This solved the situation where I had to run php artisan serve, over and over again.
Primary cause of this is running package managers as sudo. Every file is created with bad permissions.
I'm taking over the development of a php project using Laravel framework and beanstalkd driver for queuing jobs. This application was passed from a Mac development environment (that runs a beanstalkd driver) to a Windows 7 environment (beanstalkd not available for Windows machine -- at least not without cygwin tricks). So I've decided to use Vagrant homestead vm on VirtualBox that comes with an entire set of tools and servers including beanstalkd.
The application runs fine on my localhost until I try to send form data through POST header. I kept getting a "417 Expectation failed" HTTP error. I read somewhere that there maybe an issue with my proxy and could be fixed by disabling it. But as I see it, no proxy is used in my host machine -- I don't know about the guest (vm) though.
Could anyone help me solve this issue? Thanks.