Running laravel migration on heroku server - php

I have a production server, and i have deployed the code into the server, but when i try to migrate the databse with this command :
heroku run php artisan
This what i have returned
Running php artisan on [app-name] ... up, run.3899
bash: php: command not found
And the BUILDPACK_URL in the Config Vars set to
https://github.com/heroku/heroku-buildpack-php
any help please :) ?

Related

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

Heroku bash cannot find php command

I wanted to publish Laravel App on Heroku today but Heroku bash couldn't find php command.
I update database details in config/database.php and next want to run migration but when i go to heroku run bash and php artisan migrate --app myappname I only see bash: php: command not found
I'm on Windows10.
Problem solved. In composer.json i had ~7.1.3 version of PHP, after change to "php": "~7.3.0" and git push heroku master it start work

Laravel server not starting

I have a fresh installed laravel app and when i run php artisan serve it shows me the server information but when i go to that server it gives a cant be reach error. I am not running Vagrant just MAMP but it used to work before. I did tried to install Vagrant in the past and it didn't work that is why i came back to MAMP only. I read something about generating a key with php artisan key:generate which didn't work. Any help is appreciated.
This is the command I am using and the result
$ php artisan serve
Laravel development server started: <http://127.0.0.1:8000>
try to uninstall the antivirus if you have one ,in my case i uninstall avast ,reboot OS and it works for me .

Laravel php artisan migrate connection refused

I am running Laravel 5 with PHP 7.0.6. When I run the php artisan update command, I get the following error:
[PDOException]
SQLSTATE[HY000] [2002] Connection refused
This is obviously database related. This happens on a production machine I have as well as local environment. My site is working in both environments.
Does anyone understand this error? Thanks.
You are missing the PHP-CLI database extension. Your site does work because your server is using the PHP-FPM (where you have the PHP extention of your database installed). But when you run php artisan migrate command you are actually executing it on the PHP-CLI.

php artisan serve - how do I get mysql to run

I'm new to all this artisan stuff. When I start my php server with
$ php artisan serve
How do I get the mysql server to run?
The MySQL server is independent of Laravel. The artisan command is just an interface to Laravel which runs PHP scripts in the background.
To start your MySQL server on Linux, you will have to run something like
sudo service mysql start
For Windows, you will get access to the server via WAMP or from the installed services.
actually if you want to modify a little bit of laravel framework , you can do it like this:
open ServeCommand.php file on /vendor/laravel/framework/src/Illuminate/Foundation/Console/ServeCommand.php
then locate to serverCommand() function
add this command
echo shell_exec('sh your_terminal_command_to_start_mysql ');
everytime you run php artisan serve it will also execute your mysql service start command
For Windows or Mac, you will need XAMPP installed to initiate MySQL. https://www.apachefriends.org

Categories