Thanks,
but unfortunately that does not work.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I've just finished my first laravel project. Now I want to put it online. When I go to one of my domains and put it online with filezilla it works. But that's the wrong domain.
I've a domain with hosting and today I attached another domain here. So if I want to put something on that domain that I just bought today I've to go to:
/Public_html/mydomain.com
But when I put my laravel project in here it doesn't work! Already found a lot of descriptions on google and they are all telling me I've to change the index.php file.
But what should be the path in index.php now>
Thanks,
but unfortunately that does not work.
This is my current path: require DIR.'/../bootstrap/autoload.php'; $app = require_once DIR.'/../bootstrap/app.php';
What is your hosting setup like?
Please show what you have tried already and how you did it.
My host is called Neostrada and I'm working with control panel. My root is: public_html/mywebsite.com. This is where I've put my Laravel project. I've made a map called laravel here in this map are all my files except the public folder. The public folder files are in public_html/mywebsite.com. In the index.php file I changed this:
require DIR.'/laravel/bootstrap/autoload.php'; $app = require_once DIR.'/laravel/bootstrap/app.php';
When I do exactly the same with another domain that I have it works. Already contacted my host but they also have now idea.
An image of my folder structure : http://i57.tinypic.com/9pml2a.jpg An image when I set my vhost: http://i61.tinypic.com/6hjh4n.jpg
I don't receive a error I just get a white page with no error in my console.
I only can find: Failed to load resource: the server responded with a status of 500 (Internal Server Error). In my storage/logs/laravel.log are only local errors.
Are you using a webhosting hotel or vps?
I'm using webhosting. When I just put an index.html file in it and go to my domain it works. But when I put the laravel project in it it doesn't.
Is your laravel application really in your path's root (mywebsite.com)? Aren't there any PHP errors?
Did you make sure that you set your permissions on the storage directory?
Yes the permissions are right, also it's in the root path. I've contacted my host again if they have something useful I will let you know.
Just want to check, as I may be misreading.
Are you saying that your Laravel project is in the root (public_html/mywebsite.com) And then saying that you've taken the files within /public, and put them straight inside the root too? (public_html/mywebsite.com).
I may be misreading, but that is how I read one of your posts above.
@taijuten I've now put it in the root:
see picture: http://tinypic.com/view.php?pic=9pml2a&s=8#.VfA24_mqpBc
I've contacted my host. They receive this error:
Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /home/lnpo1q/public_html/index.php on line 50.
This is my index.php:"
/* |-------------------------------------------------------------------------- | Register The Auto Loader |-------------------------------------------------------------------------- | | Composer provides a convenient, automatically generated class loader for | our application. We just need to utilize it! We'll simply require it | into the script here so that we don't have to worry about manual | loading any of our classes later on. It feels nice to relax. | */
require DIR.'/laravel/bootstrap/autoload.php';
/* |-------------------------------------------------------------------------- | Turn On The Lights |-------------------------------------------------------------------------- | | We need to illuminate PHP development, so let us turn on the lights. | This bootstraps the framework and gets it ready for use, then it | will load up this application so that we can run it and send | the responses back to the browser and delight our users. | */
$app = require_once DIR.'/laravel/bootstrap/app.php';
/* |-------------------------------------------------------------------------- | Run The Application |-------------------------------------------------------------------------- | | Once we have the application, we can handle the incoming request | through the kernel, and send the associated response back to | the client's browser allowing them to enjoy the creative | and wonderful application we have prepared for them. | */
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel->handle( $request = Illuminate\Http\Request::capture() );
$response->send();
$kernel->terminate($request, $response);
If you have the facility, don't try and change the folder structure. Leave the public files in the public folder, and map your domain to /public. Doing this makes Laravel much more secure.
oke, I've changed that now I still receive the error:
Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /home/lnpo1q/public_html/public/index.php on line 50
I don't understand it when I put it on my other domain exactly the same it works.
Have you changed your index.php at all? If so, copy the original back over. You shouldn't really need to change that file.
I already did that but still not working.
I really don't understand it anymore. I've two domains and put exactly the same on it. One works the other one doesn't. This is the domain: http://www.leaseregistratie.nl. I've made sure that public is the main root. I didn't edit the index.php at all. And my host gives me the error: Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /home/lnpo1q/public_html/public/index.php on line 50.
I work with control panel and have made the rood directory public_html/public with addon domains.
What PHP version is your host running?
@bhulsman PHP-version 5.4.43
Please check http://laravel.com/docs/5.1/installation#installation
You need PHP 5.5.9
@taijuten thanks for that! I assumed that both domains had the php same version. But obviously not,....
Please or to participate in this conversation.