Eduardo Fuerte
asked on
Could you point what configuration is probably preventing a Laravel site to work in web?
Hi Experts
Could you point what configuration is probably preventing a Laravel site to work in web?
I developed a simple Laravel app in localhost.
I intend to test it under prodution.
My internet server provider had informed all it's needed to dispose that is still provided.
But the site doesn't work out.
Thanks in advance.
Could you point what configuration is probably preventing a Laravel site to work in web?
I developed a simple Laravel app in localhost.
I intend to test it under prodution.
My internet server provider had informed all it's needed to dispose that is still provided.
But the site doesn't work out.
Thanks in advance.
You are not providing a lot of information.
- Does it work on localhost?
- What happens on the ISP's server?
- Providing a link to the site on the web may be a great help.
ASKER
Ok, let's walk before we run:
For this test, all you require in .htaccess is
Visit the URL and you should see your PHP config. If you don't, your web hosting setup is wrong.
Try that, and then we can go to the next step.
For this test, all you require in .htaccess is
DirectoryIndex index.php
For a Laravel app, you would normally have
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
To check if your web hosting setup is OK, create an index.php file exactly as follows:
<?php
phpinfo();
and nothing else.Visit the URL and you should see your PHP config. If you don't, your web hosting setup is wrong.
Try that, and then we can go to the next step.
ASKER
You are confusing me - the result looks like the PHP config, not a blank page.
ASKER
Sorry.
What I mean is
1. The hosting is OK, accordingly with the php info image above.
2. Configuring .htaccess at the application folder with
Eliminating the app root's index.php
Eliminating the app root's .htaccess
(Maintainig only the default index.php that is at Laravel's public folder)
The result is a blank page.
What I mean is
1. The hosting is OK, accordingly with the php info image above.
2. Configuring .htaccess at the application folder with
DirectoryIndex index.php
Eliminating the app root's index.php
Eliminating the app root's .htaccess
(Maintainig only the default index.php that is at Laravel's public folder)
The result is a blank page.
ASKER
Mistake:
Eliminating the app root's .htaccess
Correct:
Eliminating the public folder .htaccess
(accordingly with the picture)
Eliminating the app root's .htaccess
Correct:
Eliminating the public folder .htaccess
(accordingly with the picture)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I read.
I don't know if correctly understand,
If I have Codeigniter and pure PHP... in this site, a Laravel app could cohabit independently?
I don't know if correctly understand,
If I have Codeigniter and pure PHP... in this site, a Laravel app could cohabit independently?
ASKER
Hi
Since the subject derivated from the original purpose of the question I openned another question:
https://www.experts-exchange.com/questions/28954724/Could-you-explain-how-to-create-a-Linux-virtual-server-to-use-Laravel-on-the-WEB.html
Since the subject derivated from the original purpose of the question I openned another question:
https://www.experts-exchange.com/questions/28954724/Could-you-explain-how-to-create-a-Linux-virtual-server-to-use-Laravel-on-the-WEB.html
You could test out Laravel website with dedicated servers where you get staging url instead of shared server. Try out any laravel hosting provider that provides staging url. You can deploy your site there with git or sftp and test the site out.