I'm trying to push a Laravel project to production on Hostgator.
I followed this tutorial. Only the last step, changing one line on paths.php I couldn't accomplish because this file do not exists anymore on Laravel: http://shincoding.com/laravel/installing-configuring-laravel-shared-hosting/
I put all my project files on root/quasenerd_base/quase-nerd, except the content of the public folder, which I moved to root/public_html.
I successfully change the path on index.php to the quasenerd_base folder:
require __DIR__.'/../../quasenerd_base/quase-nerd/bootstrap/autoload.php';
$app = require_once __DIR__.'/../../quasenerd_base/quase-nerd/bootstrap/app.php';
When I access the url http://quasenerd.com.br, I can see my main layout. But it won't load the #section of the page.
In addition, any other url that I try to access returns a 404 page not found. (for example, /login). Apparently I can't access any of my views.
I tryed to add to my index.php:
$app->bind('path.public', function() {
return __DIR__;
});
but it didn't work.
Any ideas?
I have one project on shared hosting and I use this tutorial: YouTube
I hope it will help you.
Related
Hello everyone i am new to laravel and i hope someone can help me about my problem. I created a laravel project. After that I import it to cpanel using softaculous. Then, I made some changes base on what i research in the net to avoid showing important file like .env . I created a folder relative to public_html, let say the folder name is 'tamangbilang' where i put almost all of my code except the index.php. Inside my public_html folder, I have another folder named as 'tamangbilang' where my index.php resides. I have followed this instruction https://dev.to/pushpak1300/deploying-laravel7-app-on-shared-hosting-hostinger-31cj the only difference is that I put another folder inside public_html.I also did some changes on the index.php code
require __DIR__.'/../../tamangbilang/vendor/autoload.php';
$app = require_once __DIR__.'/../../tamangbilang/bootstrap/app.php';
Everything is working fine on my login page(my first page) but when I try to login, an error occur.
The requested URL was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
It seems like the connection between routes was lost. I did further testing and I notice that the code is working well only if there is an index.php, before the route in the url. example
http://my-sample-domain.org/tamangbilang/index.php/login
P.S. I don't have access for ssh.
go to bootstrap folder & open cache folder then delete config. after that please check your routes this error basically arises due to routes not found for that go to your project installed on local and write php artisan route: list check if the route is present or not.
I'm trying to set up Codeigniter in my mac, but with no luck. When loading every page, appears a blank page.
I'm following the Codeigniter tutorial from the official site.
Checked the base URL configured in config.php, but seems to be ok, now: http://localhost:8080/
Also, the directory where there is the file that I'm trying to open seems to be in the correct folder: nfs://192.168.64.2/opt/lampp/htdocs/application/views/pages
The pages.php code is the next:
<?php
class Pages extends CI_Controller {
public function view($page = 'home')
{
}
}
I expected to load about.php and appear the header, about page and footer.
to load the view in codeigniter, you need to add below line of code in your controller function.
$this->load->view($page);
note: I am assuming that you have all the view pages are located at the route of application/views/ folder.
When you download Codeigniter and is extracted, generate a "Codeigniter xxx" folder with files. Is necessary to copy this folder to htdocs folder and rename with the name that you want for your project.
If you copy the files instead the folder inside htdocs, could produce this problem.
I am trying to integrate blocked.com in my Laravel 5.2 setup but I don't want to add the blocked.com script in my public folder. I have kept the scripts in app/Libraries folder. Now the issue is to open a PHP file from that folder (from outside public folder).
I am trying this
Route::get('/block-det', [function () {
return redirect()->to('../app/Libraries/blockscript/detector.php');
}]);
But it's redirecting me to https://example.com/app/Libraries/blockscript/index.php
redirect redirects you to a new url, which is why you get redirected to the url you pasted above. You simply want to call that php file. You can do so using require:
Route::get('/block-det', function() {
require '../app/Libraries/blockscript/detector.php';
});
Depending on the location of detector.php you may need to change the path.
Also, it is much more typical, if you are pulling in 3rd party code, to use composer to pull it in, then it is automatically installed in the vendor folder and you can access it from your app that way.
I am the designer for a small business and I have been tasked with trying to get a Laravel project to work on the customer's server. I am not a PHP expert and only know a small amount - I've taken this on at very short notice due to a very tight deadline and my clients inability to find anyone else at such short notice.
I have attempted a Google search but nothing seemed to help. The file structure of the cPanel is as follows:
All of which is inside the handymans-hardware.co.uk folder. When I navigate to the domain root I can just see the file tree and when navigating to root/public in the browser I get an error. How can I set this up? It seems the developer that built this didn't set it up correctly and has caused some issues.
Here is the error:
Line 50 of index.php is $kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
When uploading Laravel to cPanel there are some few things you have to note
is your hosting provider having php 7.2 enabled
are your files in the public html directory
copy every thing in the public directory of your Laravel application and paste them at your root directory
if you have done that then check your index.php file that have now been moved to the root directory and do this
look for this lines of code in the index.php
require __DIR__.'/../vendor/autoload.php';
$app = require_once __DIR__.'/../bootstrap/app.php';
Then edit those two above to this
require __DIR__.'/vendor/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';
If you are still confused view this video tutorial: Youtube Upload Laravel to cpanel
Looking at the screen shots, it appears you did not upload the site content to public_html?, I could be wrong, but upload what you have inside of the project folder "handymans-hardware.co.uk" directly to public_html (seems simple and you may have done this, but thought I would ask)
Appears there is some SQL table errors triggered as well navigating to: http://www.handymans-hardware.co.uk/shop
I've setup Homstead which is working fine, but the web site is showing 403 forbidden error. If I put a index.php file in the public folder then it shows the content of the index.php file as expected. I have removed the index.php file and setup a laravel app within the public folder. This creates the 403 forbidden error again. If I point the web browser to homestead.app/lts/resources/views/welcome.blade.php it will show the laravel welcome page. 'lts' is the name of the project, it looks like laravel is not loading or pointing to the correct file to load. Any help will be much appreciated. I am new to laravel, I use to use codeigniter so I do understand how frameworks, work a little.