laravel localhost base_url 500 - php

I've had an app built for me using laravel and I'm trying to get it running on my local machine (MacBook pro running MAMP).
The lead developer is currently away so i was hoping someone could help me with my problem!
No matter what I do, I only get a white page when trying to run the app from a browser, even though I believe I've set the config and htaccess file correctly.
Mamp is running on port 8888 and the app is in the 'event' directory. The config file has the base url as:
$config['base_url'] = 'http://localhost:8888/event/';
but all I get is a white page. I have checked php and thats running fine, and if I call other files outside of the laravel app they all work.
I'm wondering if there's a way I can diagnose the issue using the developer bar or some other tool? At the moment all I can see is a 500 error.
Thanks!

Related

Working Laravel in CPanel but not in localhost without Artisan

I've installed in my remote server, via Softaculous, Laravel 8.
In order to access directly to the APP, just like when running php artisan serve in my local machine, in CPanel i defined the document root to the folder Laravel\public.
Everything works exactly as it should! I type the address (ex: myDomain.com) and the App runs perfectly...
However i don't want to being always typing php artisan serve while developing, so i tried to replicate the cpanel struture in my local machine.
To achive thar, i've created a virtualhost in XAMPP httpd-vhosts.conf pointing to the folder Laravel\public, and created the host file in windows system, like always.
When accessing the location in my local machine the first page renders perfectly, but as soon as i make a request for a new view, by example:
Route::get('/posts', function () {
return view('posts.index');
});
I get a "Not Found The requested URL was not found on this server" error! I'm sure is not a coding error because the same code runs flawlessly in remote server.
Which technique is used by cpanel to allow laravel to work directly from \public folder without necessity to initiate anything and how to replicate that in local development machine?
Well...
After much reading, backs and forwards, i believe this behavior depends on the way Apache its served by XAMPP.
So, the solution i adopted was change my local development tool to LARAGON.
Everything worked just fine with a lot of new features that donĀ“t exist in XAMPP.

localhost error #500 MAMP

Yesterday I transferred a live WordPress site and successfully setup my local dev environment using MAMP. I was able to get my database exported from my live site and imported locally. I was able to login and see my site, but to my surprise this morning, I am not able to access the site anymore. I am however able to access my localhost, but once I select and enter the root folder I get the always unwelcome "localhost is currently unable to handle this request. error 500".
I am not sure what's happened since yesterday to cause this and I've searched the forums, but I'm at a loss. I am new to local PHP development, so I might be missing something simple. I appreciate any and all help.

How to correctly publish CakePHP 3 to external server?

I'm writing application in Cakephp-3. I have got local server (Xampp) and external (Apache).
In my local server, all redirect works fine, but when I upload my Cakephp project into external server, I have got error while invoking links.
Error: The view for OnasController::index() was not found.
such a view, of course, exist there!!
I think that's the fault of an external server configuration: path, webroot etc.
I will be very grateful for any solution that help solve my problem.
This is my screen where is project localization.
Ok sorry !! Edited !!!

Forbidden - you don't have permission to access occurring randomly on Browser

I have my website live on Cent Os Server Apache 2.2.15. Developed on PHP Codeigniter.
I get Forbidden error for the 1st time as I visit the website.
But then as I refresh it goes away and the page is loaded perfectly.
This happens to random users and not for everyone.
For some the site runs smoothly without any error.
For me it looks like a configuration difference between those two servers. Make sure that both servers have exactly the same:
Apache configuration
PHP configuration
folders structure and permissions

CodeIgniter base_url with port number

I built a website in CodeIgniter in my local machine with Apache. The website works fine. Then I moved it to IIS in the same machine and converted the htaccess to web.config, and the website still works fine with no problems. Then I moved my website to an IIS remote server in the same network, created a new site in IIS and set it up on port 81. Then I modified the base_url in the config file in CodeIgniter to http://192.168.1.40:81/.
Now when I try to access my website under that URL, I get 500: Internal server error.
I'm not sure what's causing the problem. The only cause I can think of is the port number in the URL because the website was working in my local IIS, but there was no port number in the URL or base_url. It was just the default 80.
Does anybody have a suggestion for this problem?
Thank you very much for your help. I found the solution. Joachim Isaksson was right about php not installed. when I created the website on iis, I thought php was added to the website automatically, but I was wrong. You need to add php to every new site you create in iis (if i'm wrong, please tell me how to set up php to be added automatically when a new site is created in iis.) Then I installed the url_rewrite in iis. and the problem was solved.
Thank you guys again

Categories