Can't run Lumen Laravel - php

I have really silly question. I am new at Lumen. I find out that in 5.2 and 5.3 there isn't a command php artisan serve. How can I run it using xampp?

You may use php built in server in your project root in cli php -S localhost:8000 -t public

Related

Clockwork Laravel not working when start app with command 'php -S 172.17.48.1:8003 -t public'

I have multiple microservices in Laravel and Lumen.
The service that developed in Laravel runs clockwork in local environment with php artisan serve command.
But same service deploy on EC2 AWS and it's not working. Errors screenshot attached.
What I observe that in production it does not run with php artisan serve command.
Another Lumen service also does not working with clockwork even on Local environment. This lumen service run with php -S 127.0.0.1:8000 -t public command.

Laravel 7.28 not work without php artisan serve command in localhost

Laravel 7.28 not work without php artisan serve command in localhost
I install new Laravel in localhost (/var/www/html/NewLaravel)
When I run http://localhost/NewLaravel/public/ not workling
but when I run with php artisan serve its working on http://127.0.0.1:8000/
Apache2 is working proper and allow access of override for .htaccess
is that new Laravel will only work with php artisan serve ?? or something is missing from my side ?
Step-1:
run apache and sql from xampp server
step-2:
in browser type localhost/NewLaravel and press enter
Step-3:
in list please select public folder it will run

How to start local server with symfony 5 or downgrade version to 4.4?

I started a new project in new Symfony 5 and i can't open my local server.
On Symfony 4.4 the command PHP bin/console server:run is OK,
But with Symfony 5 the command appears not to be defined...
C:\Users\Chris\Code\api-test> php bin/console server:run
Command "server:run" is not defined.
Do you want to run "server:dump" instead? (yes/no) [no]:
So how to downgrade or start the local server?
The Web Server Bundle is not included with Symfony 5.
But you can simply require it and install it separately.
E.g.:
composer require symfony/web-server-bundle 4.4
It is important that you specify the version (4.4), because otherwise it will attempt to install version 5 (which does not exist, and it will fail).
After that you'll be able to run bin/console server:run as you used to do.
Otherwise, you may use the Symfony CLI as well. This is an executable binary which includes the Symfony Server by default. Then you may run symfony server:start or the better know alias symfony serve to start the local webserver.
Read more about Symfony's server here.
You can also use the built-in web server in the PHP runtime. Just go to your project's root directory and run:
php -S localhost:8000 -t public/
It's not a fully featured webserver, but for developing purposes it is usually more than enough.
For running a local web server you can now use Symfony Client, or simply 'Symfony'.
Download the binary and install it globally.
Open a terminal and run once: symfony server:ca:install. This will install a local SSL certificate authority that allows you to run the local webserver on https://.
Inside the terminal, move into your project directory and run symfony serve. A local webserver will start; by default on https://localhost:8000/.
If you wish to run the webserver on another port you can use symfony serve --port=8080 (in this case port 8080). For the most useful commands Symfony Client has to offer, simply run symfony. To see all available commands run symfony help.
I am using symfony 5 and I just replace the former command php bin/console server:run" by php -S localhost:3000 -t public and it works in a similar way.
-t public to indicate the targeted file.
php -S localhost:9000 -t public | PHP Inbuild Server / -t set to the public dir
php bin/console server:run | Only for Symfony 4.* and below
symfony serve | Symfony Server symfony ServeBundle
To run symfony serve you must first install the ServerBundle: composer require symfony/web-server-bundle
The really really really cool think is that you can use https out of the box. You need only run symfony server:ca:install.
I am using symfony 5,4 and I just use command
$ symfony serve
You need to install symfony by running theses commands:
cd my-project
composer require symfony/web-server-bundle --dev
And run the server
php bin/console server:run

Why can't I run my laravel app with PHP artisan serve?

I'm working on a laravel app. I made the simple installation of a new laravel app, and in the previous days it was running great.
But now I'm not able to access my project in browser after running php artisan serve. The browser just says page not found and the buffering of that page is like infinite.
I tried to run the server in a different port with:
php artisan serve --port=9000
and then accessed it in http://127.0.0.1:9000/
It run well once, but then it stopped again.
You could try out the following:
php -S localhost:8000 -t public To run withe inbuilt PHP server
Make a fresh installation of a laravel project and copy your files into it.
It didn't work for me but I used composer:
php artisan serve --port=9000
Then it hanged. I press CTRL+C and I got it working without any errors
Try this, I got solved by these;
1) Change the default url to like this - localhost/<your-project-name>/public/ instead of default one 127.0.0.1:8000
or
2) use this php -S localhost:8000 -t public or php -S 127.0.0.1:8000 -t public

How can I change the Laravel Artisan CLI PHP version?

I posted a question about clearing the cache here
the problem was I can't clear cache after editing the .env file. That is still my real problem. (I can't reset the server and I cant use artisan cmds)
But this problem needs to be solved before I can solve that one:
I cannot run artisan commands. I have a shared hosting account where my environment PHP version is 7.14 the PHP artisan CLI is using the default PHP 5.4 so I cannot do: php artisan cache:clear etc
I have tried things like
$exitCode = Artisan::call('config:cache');
And...
$process = new Process('/opt/php71/lib artisan config:cache');
$process->run();
Keep in mind that my application works fine, and PHP version is 7.14 according to PHPINFO.
So how can I either get Laravel to clear its cache another way or get artisan to run using a specific PHP version?
where my environment PHP version is 7.14 the PHP artisan CLI is using the default PHP 5.4
No, artisan will use whatever version your environment is set to run – the shebang looks like this:
#!/usr/bin/env php
And if you're calling it like php artisan ... then the shebang isn't even used. In either case, you should adjust your path so that PHP 7.1 is called when you run php (i.e. the directory containing PHP 7.1 should come before the one containing 5.4) and it will work fine.

Categories