Cannot access specific pages in laravel on XAMPP - php

Laravel installation on XAMPP only shows pages in /public. When i try to go a page like /business/register which is in /resources. I get a 404 page. I've set the vhosts file on XAMPP properly. The code is below.
I've tried almost everything and even checked .htaccess. Couldn't find the problem.
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/pos"
ServerName pos.dev
<Directory "C:/xampp/htdocs/pos">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
Require all granted
</Directory>
</VirtualHost>
With this config, it should work

check to make sure that there is .htaccess in you public folder

DocumentRoot "C:/xampp/htdocs/pos/public"
<Directory "C:/xampp/htdocs/pos/public">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
Require all granted
</Direcroty>
i recommended using homestead https://laravel.com/docs/5.7/homestead

Related

How to create a dyanmic virtual host in wamp stack

Iam finding a way to dynamicaly create vhosts I tried this one but it's not working
<VirtualHost *:80>
UseCanonicalName Off
ServerAlias *
VirtualDocumentRoot "D:/WAMP/apache2/htdocs/projects/%0/current"
VirtualScriptAlias "D:/WAMP/apache2/htdocs/projects/%0/current"
LogLevel debug
<Directory "D:/WAMP/apache2/htdocs/projects/">
Options Indexes FollowSymLinks
AllowOverride All
Order Allow,Deny
Allow from all
Require local
</Directory>
</VirtualHost>
I set the hosts file too but when I load my vhost name it would load the localhost index file instead of my project. I just want to do this to make less hassle setting up new projects :) thanks. I'm using windows 8.1.

Mamp Pro alias to directory?

Trying to add this simple code to my httpd.conf but it gets overwritten each time I start the server
Alias /ws /path/to/public
<Directory /path/to/public>
   Order allow,deny
   Allow from all
</Directory>
There are spots in mamp pro to enter stuff but I can't find any documentation on what they do.
http://wes.io/L9t9/content
Help?
The answer might be a little late... but for everyone searching
The first field "Customized virtual host directory Settings will be added to the directory section:
<Directory /path/to/public>
Order allow,deny
Allow from all
#My directory options
</Directory>
The second field "Customized virtual host general settings" will be pasted in the virtual host section:
<VirtualHost *:80>
#My virtual host options
</VirtualHost>
So in your case, just put everything inside the SECOND box and it will look like this with default settings:
<VirtualHost *:80>
ServerName your-servername.dev
DocumentRoot "/your/path/to/public"
<Directory "/your/path/to/public">
Options Includes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Alias /ws /path/to/public
<Directory /path/to/public>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
You can always check what happened in the following path:
/Users/<YOUR-USERNAME>/Library/Application Support/appsolute/MAMP PRO/httpd.conf

Problems in installing Laravel at localhost

I am trying to install PHP-Laravel in Windows 8 and I am using Xamp server(localhost). I am following Installing Laravel guide.
According to this guide I am making virtual host using following code :
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/TssApp/public"
ServerName TssApp
<Directory "C:/xampp/htdocs/TssApp/public">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
</Directory>
</VirtualHost>
//Where "C:/xampp/htdocs/TssApp/public" is path of Laravel public folder
and I have also added following line in in etc/hosts
127.0.0.2 TssApp
After doing necessary steps mentioned in this tutorial when I type "http://TssApp" , it always redirect to "http://tssapp/xampp/" instead of Laravel Home page. I don't know if I am missing any thing.
Note: I can access laravel home page at "http://localhost/tssapp/public/" but want
to use "http://TssApp" link to access my application.
Please help me regarding this issue.
Thanks .
Do you have NameVirtualHost * in your virtual-hosts configuration?
You'll need to restart Apache after any changes to either /etc/hosts or your virtual-hosts configuration files
Try adding the code to C:\xampp\apache\conf\extra\httpd-vhosts.conf instead of adding it to your own conf file. As far as I know xampp will ignore it unless its in the vhosts file.
You could try this.
<VirtualHost *>
DocumentRoot "C:\xampp\htdocs"
ServerName localhost
</VirtualHost>
<VirtualHost *>
DocumentRoot "C:\xampp\htdocs\TssApp\public"
ServerName tssapp
<Directory "C:\xampp\htdocs\TssApp\public">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Although you should put your files in the xampp directory and not the htdocs directory, so your files should be C:\xampp\TssApp\public, This would stop people from visiting htdocs which is a public folder and getting access to your application.
According to the documentation (that you point to), you should write
<VirtualHost 127.0.0.2>
and not
<VirtualHost *:80>
Could you try that and restart your computer/server?
Add in:
Allow from all
after
AllowOverride all
The end result should be:
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/TssApp/public"
ServerName TssApp
<Directory "C:/xampp/htdocs/TssApp/public">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Allow from all
</Directory>
</VirtualHost>
Also make sure you are editing the file "httpd-vhosts.conf" found in:
C:\xampp\apache\conf\extra

WAMP Server ERROR "Forbidden You don't have permission to access /phpmyadmin/ on this server."

Hi Friends previously I am using XAMP Server but when I install joomla Templates it creates alots of error. Now I installed the WAMP, but the issues are:
1. I can access with 127.0.0.1, but I cant access with "localhost".
2 When i access phpmyadmin i get this error.
Forbidden You don't have permission to access /phpmyadmin/ on this server.
Alias /phpmyadmin "c:/wamp/apps/phpmyadmin3.4.5/"
# to give access to phpmyadmin from outside
# replace the lines
#
# Order Deny,Allow
# Deny from all
# Allow from 127.0.0.1
#
# by
#
# Order Allow,Deny
# Allow from all
#
After changing, it will look like this
<Directory "c:/wamp/apps/phpmyadmin3.4.5/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
</Directory>
After this just restart Wamp
Go to C:\wamp\alias. Open the file phpmyadmin.conf and change
<Directory "c:/wamp/apps/phpmyadmin3.5.1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
to
<Directory "c:/wamp/apps/phpmyadmin3.5.1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>
problem solved
Change httpd.conf file as follows:
from
<Directory />
AllowOverride none
Require all denied
</Directory>
to
<Directory />
AllowOverride none
Require all granted
</Directory>
So none of the above stuff worked for me. Except this:
edit httpd.conf,
find the line
Listen 80
and change to
listen 0.0.0.0:80
if you are running windows 8, its got something to do with using ipv6 instead of ipv4
Go to C:\wamp\alias.
Open the file phpmyadmin.conf and add
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from MACHINE_IP
Change in following file \bin\apache\apache2.2.22\conf\httpd.conf
Replace Listen 80 with Listen 0.0.0.0:80
Replace
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
with
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>
Replace
onlineoffline tag - don't remove
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
with
onlineoffline tag - don't remove
Order Deny,Allow
Allow from all
Allow from 127.0.0.1
in \wamp\alias\phpmyadmin.conf
replace
<Directory "c:/wamp/apps/phpmyadmin3.4.10.1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
with
<Directory "c:/wamp/apps/phpmyadmin3.4.10.1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
</Directory>
Tested on windows localhost.
Note : Please consider RigsFolly's comment also.
For WampServer 2.2 with Apache 2.4.2 I ended up with:
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Require local
To solve this, I opened httpd.conf and changed the following line:
Allow from 127.0.0.1
to:
Allow from 127.0.0.1 ::1
I faced this problem
Forbidden You don't have permission to access /phpmyadmin/ on this server
Some help about this:
First check you installed a fresh wamp or replace the existing one. If it's fresh there is no problem, For done existing installation.
Follow these steps.
Open your wamp\bin\mysql directory
Check if in this folder there is another folder of mysql with different name, if exists delete it.
enter to remain mysql folder and delete files with duplication.
start your wamp server again. Wamp will be working.
just add following line in wamp/alias/phpmyadmin.conf
Allow from ::1
so it will look something like this depending your phpmyadmin version.
<Directory "c:/wamp/apps/phpmyadmin3.5.1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
Allow from ::1
</Directory>
If its possible uninstall wamp then run installation as administrator then change you mysql.conf file like that
<Directory "c:/wamp/apps/phpmyadmin3.5.1/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Allow,Deny
Allow from all
Allow from all
</Directory>
Not: Before I reinstall as admin the solution above didn't work for me
Change the file content of c:\wamp\alias\phpmyadmin.conf to the following.
<Directory "c:/wamp/apps/phpmyadmin3.4.5/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Allow from all
</Directory>
Here my WAMP installation is in the c:\wamp folder. Change it according to your installation.
Previously, it was like this:
<Directory "c:/wamp/apps/phpmyadmin3.4.5/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Directory>
Restart your Apache server after making these changes.
In your apache config file (../bin/apachex.y.z/cong/httpd.conf)
Just change
< Directory "c:/wamp/www/" >
...
...
"Require local" ===> "Require all granted"
< /Directory >
This allows other pc's to access (to read) your web folder.
I had done below changes for new phpmyadmin4.0.4 in httpd.conf file
<Directory />
AllowOverride none
Require all granted
</Directory>
and phpmyadmin.conf
<Directory "c:/wamp/apps/phpmyadmin4.0.4/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order Allow,Deny
Allow from all
</Directory>
and restart my server.
None of the above answers worked for me, or where unsafe (as some pointed out, using Allow from all can make your files and data accessible to the outside world).
Open the c:\wamp\alias\phpmyadmin.conf file and change
Allow from 127.0.0.1
to
Allow from 127.0.0.1 ::1
Explanation:
On most computer systems, localhost resolves to the IP address 127.0.0.1, which is the most commonly used IPv4 loopback address, and to the IPv6 loopback address ::1 (source: https://en.wikipedia.org/wiki/Localhost)
The resolution of the name localhost into one or more IP addresses is configured by the following lines in the operating system's hosts file:
127.0.0.1 localhost
::1 localhost
to see your hosts file, go to c:\Windows\System32\drivers\etc\HOSTS
notice the above lines are commented out with the note: # localhost name resolution is handled within DNS itself.
On my machine, on Win7, I also noticed the following:
localhost\phpmyadmin did not work on Chrome, but worked on IE11
127.0.0.1\phpmyadmin worked on Chrome
comment Require local from httpd.conf
"#Require local"

about httpd.conf

I'm starting to learn symfony for php framework and I got problem with httpd.conf configuration.
First, I have xampplite installed on my windows c:\xampplite\
and then I created a symfony project (as described on getting started guide)
c:\xampplite\htdocs\symfonytest\
Everything works fine when I tried to access http://localhost/symfonytest/web/
(all icons and text are displayed pretty well)
Now I got to configure the httpd.conf and I type like this:
<VirtualHost 127.0.0.1/symfonytest>
DocumentRoot "c:\xampplite\htdocs\symfonytest\web"
DirectoryIndex index.php
<Directory "c:\xampplite\htdocs\symfonytest\web">
AllowOverride All
Allow from All
</Directory>
Alias /sf c:\xampplite\htdocs\symfonytest\web\sf
<Directory "c:\xampplite\htdocs\symfonytest\web\sf">
AllowOverride All
Allow from All
</Directory>
But it has no effect at all ... when I type http://127.0.0.1/symfonytest/ it still displayed directory list of my c:\xampplite\htdocs\symfonytest\
How to solve this httpd.conf problem?
Thank you !!!
You can't do that using a VirtualHost. Instead, use an Alias:
Alias /symphonytest/ "c:\xampplite\htdocs\symfonytest\web"
<Directory "c:\xampplite\htdocs\symfonytest\web">
AllowOverride All
Allow from All
</Directory>
Alias /sf/ c:\xampplite\htdocs\symfonytest\web\sf
<Directory "c:\xampplite\htdocs\symfonytest\web\sf">
AllowOverride All
Allow from All
</Directory>
This should work as you're expecting it to.

Categories