Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

snaix93's avatar

Js is not working on godaddy hosting

I have uploaded my Laravel project on goDaddy and as i can see Jquery is not working. I have extracted all the css and js files from public folder to the main folder. Console is not giving any errors about the js file. http://stproduct.co.uk/index.php/home. The project is just a new laravel 5.3 project+command php artisan make:auth. This is the path for js from layouts/app.blade.php

This is the file index.php:

require DIR.'/bootstrap/autoload.php';

$app = require_once DIR.'/bootstrap/app.php';

$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);

$response = $kernel->handle( $request = Illuminate\Http\Request::capture() );

$response->send();

$kernel->terminate($request, $response);

All the files are located in public_html. All the files from public folder are extracted in public_html.

The web site: http://stproduct.co.uk/index.php/home

0 likes
9 replies
Abi's avatar

is it a share server?

snaix93's avatar

I am not sure, but i think yes. How can i check?

Abi's avatar

@snaix93 Most likely in your dashboard, it should say the package you've got.

Ok. Remember that your domain has to be pointed to the public folder inside the laravel folder. I believe your domain is pointed to the public folder within your account.

are you able to change the domain point location?? as this is the best way to do it. If not we can get around it but be aware that you will have to include some setting in your first htaccess files for security reasons

as you can see I can access your .env file which is not good.

http://stproduct.co.uk/.env

let me know if you can point your domain to the public folder in laravel

snaix93's avatar

I have tryied to put all the site files into the folder, have changed index.php file for new directions but env file is still possible to access thru the link like that: http://stproduct.co.uk/.env but adding the folder after uk/. How to hide the env file? is that from cPanel from somewhere?

Also i tryied to add another project but the page is not loading those lines:

and because of that bootstrap and js are not working. This is the error message from console: Uncaught TypeError: $(...).prettyPhoto is not a function at HTMLDocument. (main.js:67) at j (jquery-1.11.1.min.js:2) at Object.fireWith [as resolveWith] (jquery-1.11.1.min.js:2) at Function.ready (jquery-1.11.1.min.js:2) at HTMLDocument.J (jquery-1.11.1.min.js:2) main.js:27 Uncaught TypeError: $portfolio.isotope is not a function at main.js:27 at dispatch (jquery-1.11.1.min.js:3) at r.handle (jquery-1.11.1.min.js:3)

how to set the right route?

snaix93's avatar

Can someone give me a project that is working on godaddy that i can download and deploy by myself to be sure that the code is right? That may be a simple project even a project after php artisan make:auth, i will set the env for me, because i have few projects and right now i don't know the problem is in project or in the mode i am setting the routes.

Snapey's avatar

Its simple really.

If your provider gives you hosting space that has a public_html folder, go to your local Laravel install and rename the public folder to public_html

copy all your project to the parent of public_html

Make sure you set the storage folder as writeable and you should be good to go.

Abi's avatar

@snaix93 this is because of the file structure mate. you need to point your domain to your laravel public folder. you're using cpanel right? there should be a domain section to change it there

snaix93's avatar

@abi i There was a problem creating the alias. Park::park(stproduct.co.uk) failed: You cannot park your main domain. That message i got in aliases.

This is all that i have in domains in cPanel:

Addon Domains

Subdomains

Aliases

Redirects

DNS Manager

Preview Website

I added in index file those lines: $app->bind('path.public_html', function() { return DIR; });

but didn't helped.

http://stproduct.co.uk/laravel/ this is how the page is loading now. .env file is not possible anymore to access.

Please or to participate in this conversation.