I have a Laravel web application that works perfectly on my server but when I try to install it locally on wamp, I keep getting this error
The requested URL /rms/public/users/dashboard was not found on this
server.
I have mod_rewrite enabled.
I can't seem to find a .htaccess in /public/ folder.
Download the .htaccess file and put it into your public folder.
Here' the link
And it's better to follow the installation guide to create a laravel project locally, and replace your app and public folder with the ones on server
Have you try checking composer.. sometimes you maybe using packages that are under the gitignore folder so the wont come across... if you do a pull...
Related
After I have installed TYPO3 on my local host this error occurs
The requested URL was not found on this server
I can show the login page of admin. After entering the credentials then occurs this error.
As written by Julian you need to make sure that there is the correct .htaccess file in your document root directory.
If the file is missing, you can find a sample file here:
/typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/root-htaccess
sometimes deleting .htaccess was the solution. (typo3 Install-Tool Environment offers to try repairing it. )
Rename your .htaccess, so you are able to compare differences later
This happens when upgrading from typo3 v10 to v11. The typo3v10 .htaccess is still used, and it does not have rewrites for /typo3/.
Remove the public/.htaccess file and run the install tool in /typo3/install.php and let the "Directory status" tool re-create it.
I just decide to start learning Laravel. By following Getting Started most easy solution for me seems to be to start using laravel installer.
So what I did was installed installer globally and then simply created new project via laravel new laravelapi.
After cli prepare it I edited .env file with my database info and changed APP_URL to http://localhost/laravelapi/ (I'm using XAMPP and laravelapi is name of my project). Unfortunately when I opened browser on that URL I just see the files, not a rendered website.
Funny thing is that when i open http://localhost/laravelapi/server.php site load correctly (it's just some trivial laravel default page)
I was wondering if htaccess works correctly I tried to check if my apache has mod_rewrite as one of his loaded module but it was there.
I am really new in it and I obviously missed something important, but I fight here with it for couple hours without any result. Does anyone face this issue before? If so what was the solution?
The Document Root for a Laravel project is the public directory. All user requests should be routed to public/index.php unless the file requested exists within the public directory -- e.g: assets.
You can change the document root for an xampp operated project by following the steps provided in this StackOverflow answer.
Its not good practice to access project through "http://localhost/laravelapi/public"
Probably you will face problems for symbolic links or while hosting your project. It's good to have vHost for your PHP projects.
You can create a vhost for xampp and add document root upto the public directory of your project for Laravel, like as "../Project/laravelapi/public".
Also you can use inbuilt development server command as php artisan serve
which will start your server on "http://localhost:8000".
More helpful links
1. Laravel Documentation - here
2. vHost for Xampp - Here
I got the same issue were two reasons behind the error.
one is not a proper .htaccess file placed in the root directory.
other php version is not compatible with your laravel current version (low PHP version).
You can create another .htaccess file in the main directory which will indicate that your project root is the PUBLIC folder. It will solve your problem.
you can try the sample code below.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
I had same issue but I solved this problem. When we install Laravel then .htaccess file is in the public folder.
Cut the .htaccess file from the public folder
Paste this file in root folder of project
I have recently moved one website to new server. I have transferred everything properly including mysql database. But now the internal pages are not opening (sending 404 error). Homepage looks fine.
One thing to consider here is that, the website was on shared cpanel with another domain and residing in a folder. Now after moving, it is placed directly in public_html. I hope, this doesn't create any issue.
The website is: http://nepaltrekking.co.kr/
regards,
When hosting changes, we need to take care of the following steps for codeigniter:
Check required php and apache modules are installed and enabled.
If installation is not in root directory, you must change htaccess.
If domain is changed, you need to edit config file for new base_url.
Clear application cache if enabled. Give required write permision in cache directory.
If nothing works, then see error log and correct error accordingly.
Actually I resolved it. The issue was with .htaccess. I changed the permission to 666 and it started working. I think there was problem writing in the .htaccess file.
I am just add the laravel project inside of the /var/www/html folder. When I run the application in browswer using url
http://localhost/voting_lession/public/ It works fine, but it's any routes does not work, error is like this.
instead of
http://localhost/voting_lession/public/
Try index.php after your url it might be the issue
http://localhost/voting_lession/public/index.php
You may activate the rewrite mode of apache it Will work.
Do check the path to your file for correctness in spelling; if your localhost is up as you said and Laravel properly installed, that is likely to be the problem.
I read the docs and installed lithium exactly like they have explained but I keep on getting a 403 forbidden error. I am new to apache and php and I have been spending two full days trying to make lithium work. I am running apache 2.0 on osx lion and here is what I did:
1- I created a new directory called my_app in localhost/~marwan/
2- I extracted the sample lithium app in to that directory.
3- I downloaded the lithium framework and extracted it into /libraries/lithium/
When I access http://localhost/~marwan/my_app/ I get the following 403 error:
You don't have permission to access /~marwan/mj/ on this server.
I have researched and added Options +FollowSymLinks to the .htaccess file and the error changed to:
You don't have permission to access
/Users/marwan/Sites/my_app/app/webroot/webroot/ on this server.
I have tried to add Options +FollowSymLinks to every .htaccess file but nothing changed.
I dont know if this is relevant: websites on localhost/~marwan/ work but localhost also shows a 403 error. I tried to fiddle with different permissions posted in previous answers but with no luck.
Thank you for your help.
httpd.conf file is here http://pastebin.com/jLwHPbuq
Edit:
httpd-userdir.conf is here http://pastebin.com/ZXi51pn7
httpd-vhosts.conf is here http://pastebin.com/3xqRmrzL
Update
The lithium project works when I remove the .htaccess from the main folder but it doesnt work properly because rewriting doesnt work. Here is the .htacces in the project root http://pastebin.com/vt0fVyyL
The path you provide in the error message /~marwan/mj/ and the path you provide that you are trying to reach http://localhost/~marwan/my_app/ do not match. According to the error the web server says you are trying to access a directory called mj while your url does not include mj so unless you are doing some URL rewriting this looks like an issue.
Also, just to be clear, when you say you installed the library in /libraries/litium you mean relative to the web root path, correct?
OK, looking at your conf files you can serve files out of /Library/WebServer/Documents or out of ~/Sites (that tilde represents your user directory so it is the same path as /Users/marwan/Sites)
Do this...
In /Library/WebServer/Documents place a file called index.html and have it output some text.
Make sure there are no .htaccess files in /Library/WebServer/Documents.
Make sure you have not modified your httpd.conf file in any way from its default settings.
Do you see the correct behavior for your index.html (you should)? If not, what happens?
I looked at the error log after restarting apache and found DocumentRoot [/usr/docs/dummy-host.example.com] does not exist so I fixed it by using this answer stackoverflow.com/questions/6671042/… and now it works.