0
I have a Windows finished project (wampserver) using Laravel 5.2 in php 5.5.12 working perfectly.
I’d like to know how to copy it to the server that is in Centos 7. Which is PHP 7. If I install Laravel on it it takes Laravel 5.5.
I tried to copy the project to the server and separate the public folder from the rest of the project, but it just finds the main route, which in case is my login
my route is like this:
app Routes.php
Route::get('/', function () {
return view('login');
});
Route::post('/logar', 'UsuarioController@logar');
When I try to log in, it gives error 404
The requested URL /myproject/logar was not found on this server.
He’s already got the permits
My login form looks like this:
login.blade.php
<form action="{{ action('UsuarioController@logar') }}" method="post">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<div class="form-group has-feedback">
<input type="text" class="form-control" placeholder="Usuário" name="login">
<span class="glyphicon glyphicon-envelope form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<input type="password" class="form-control" placeholder="Senha" name="senha">
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div>
<div class="row">
<div class="col-xs-8">
</div>
<!-- /.col -->
<div class="col-xs-4">
<button type="submit" class="btn btn-primary btn-block btn-flat">Logar</button>
</div>
<!-- /.col -->
</div>
</form>
My controller is like this:
Usuariocontroller.php
public function logar(){
echo "Principal";
}
public function login(){
return view('login');
}
public function sair(){
Session::flush();
return redirect( )->action( 'UsuarioController@login' );
}
Detail:
If I create an Laravel project in Centos itself, it works perfectly.
I just had to add the block to httpd.conf
<Directory "/var/www/html/portal/myproject">
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
I’m sure I was wrong about something, but where?
Young man, this isn’t about LAMP, WAMP or XAMPP. The problem is that you programmed in a version of PHP (with a version of Laravel) and are trying to publish using a newer version both PHP and Laravel. PHP itself already has some compatibility problems between smaller versions, imagine the difference that should not be from PHP 5.x to PHP 7. PHP 7 is to be completely different from the previous ones. Maybe you can even make your application "run", but you will end up finding problems halfway.
– Jéf Bueno
@LINQ beyond what you said, I’m thinking that the problem may be Mod_rewrite missing on the new server what you think ?
– Otto
@Otto Yes, the initial problem is probably only with Apache itself.
– Jéf Bueno
mod_rewrite is active
– adventistaam
So it’s not possible? I have to create another project on the server and copy my code there?
– adventistaam