How can I see the Laravel view without an artisan command CLI. I don't have CLI from my hosting provider, I only have access to FTP, to run Laravel I have to use this command in CLI:
php artisan serve --port=8080 --host=0.0.0.0
How can I get the view without this command?
Thanks.
php artisan serve is not ment for use in production environments because it uses PHP5 build in webserver. If you're with a hosting provider, they probably run Apache and you can just serve your app via Apache.
Have a look at the documentation on php.net if you want to know more about the build in webserver.
PHP applications will stall if a request is blocked.
This web server was designed to aid application development. It may also be useful for testing purposes or for application demonstrations that are run in controlled environments. It is not intended to be a full-featured web server. It should not be used on a public network.
Related
I have made a db seeder. And used command for data seed:
php artisan db:seed --class=UsersTableSeeder
Its perfectly working in localhost. Now i want to generate demo data into production server. Is there any way how i run this artisan command? Or tell me how can i load demo data into database table. Thanks in advance.
When you run the php artisan db:seed --class=UsersTableSeeder command on localhost your doing that in your terminal / console right?
You have to find your console on your web server and run the command from there. When your using a dedicated or VPS server this should be easy. When you have shared hosting it can be a little tricky, so you might need to contact your host to ask if something is possible.
So step by step:
Go to the terminal from your server
Navigate to your laravel project
Run the command
EDIT: You can also run the command on localhost and export the database. And than import it on your host. It's not the best option (And I recommend using the terminal!), but it works.
I am guessing that you are using a shared hosting server with som kind of ftp for file transferring. Because if you would have a terminal on your production server, you would've known how to execute commands on them.
If you do have a VPS or dedicated server, you can log in with SSH and execute the command just like you normally would. It could be possible that you get a warning to protect you from seeding in a production environment. But you could simply answer yes to continue seeding.
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.
I'm new on Laravel. Installed laravel on my remote server ubuntu14.04. I create a project on /www/html as blog. Then run
php artisan serve --host=10.x.x.12 --port=8010.
#Laravel development server started: <http://10.x.x.12:8010>
Its ok . I can access laravel from my local windows with that link.
The problem is I use putty for remote access. When I closed putty, I can't access anymore 10.x.x.12:8010.
How to use laravel server continuously from remote server.
Use nohup (man page) so the program does not exit when the terminal session ends.
nohup php artisan serve --host=10.x.x.12 --port=8010 &
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.