0
I passed the project of Laravel 5.4 for hosting, but now I do not know a way to use the php Artisan migrate to create my tables in the database.
I created a file in the public folder named after installation php. with the following code:
<?php
// installation.php file
echo exec('php /var/www/laravel-app/artisan migrate:install');
That way when accessed this file were automatically migrated my tables. I got the following return:
Warning: exec(): Unable to fork [php /home/MEU_ENDEREÇO/public_html/PROJETO/artisan migrate:install] in /home/MEU_ENDEREÇO/public_html/PROJETO/public/installation.php on line 3
I would like to know the ways I can perform such a procedure or to resolve this error.
Att. Thank you for your attention.
You can’t do that for
ssh
?– Woss
Sorry, I can’t do it that way :D
– MarceloSnts
There must be some tutorial on your hosting service.
– Woss
take a look at documentation of
exec ( string $command [, array &$output [, int &$return_var ]] )
has two more parameters that Voce can use,$output
is the return of the command, the output that Voce sees in the terminal, this will give you a better idea of what is happening.– Neuber Oliveira
Another problem that may be is that some hosts have PHP 5.2 installed, but with
.htaccess
enabling to run as 5.3, 5.4, etc. The problem with this is that when running theartisan
by the command line, which is what theexec()
does, will run as PHP 5.2 and therefore give a lot of error why the Laravel needs at least PHP 5.3, in which case I do not know if it has how to solve.– Neuber Oliveira
I contacted the hosting and asked to free the ssh access, from now on just run the commands of php Artisan. Thanks for the collaboration, it was of great help.
– MarceloSnts
It could also export the bank on the local phpmyadmin and then import the phpmyadmin on its host
– gesser miguel da paixao