Skip to main content

5 Most Common PHP(WAMP Server) Configuration Issues


Top 5 Configuration issues with PHP (WAMP Server)

                                     

Note : Please make sure to backup the configuration file before making any change to any  file as any wrong change will stop the server from running.
 

Also it is necessary to restart the wamp server after editing any config file, for changes to take effect.


a) IIS and WAMP on Same server(system)


This is the most common issue that many web developers needs to face. Not only with IIS , any service that uses Apache can be problematic if WAMP is running on that system.

What actually concept is :
Apache Server, by default runs on port 80
But if two services runs Apache(Say WAMP Server and IIS) then only 1 service(IIS) will be able to run Apache as only one service can run on single port.
The result of this, WAMP Stopped working.
What to do now???

Simple! Tell the WAMP to change the port for APache from 80 to say 81.
This can be done by editing your httpd.conf file(located in "wamp\bin\apache\Apache<version>\bin" directory)

Search for "80"(Without the quotes).
You will get following lines :

Listen 80
ServerName localhost:80


replace 80 with 81. Restart wamp.
and try opening 127.0.0.1:81

VOILA.................. Thats it.

b) Another problem that mostly occurs is that 403 Forbiodden error comes when try to open the server using IP instead of 127.0.0.1(or localhost).

as
                             Forbidden

                            You don't have permission to access / on this server.

This happens because by default, server has the settings which restrict it to be accessed using IP.
To resolve this, you need to follow tow steps:

a) WAMP[on the right bottom shortcut icon] -> Put Online i.e. Put the server online as by default server is offline.
b) You again need to edit httpd.conf file.

Serach for DocumentRoot "c:/wamp/www/" (Assumiung, you installed wamp on "c:/wamp/www/" location)

Just below it, you will see

<Directory "c:/wamp/www/">
    Options Indexes FollowSymLinks
    AllowOverride Nome
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
</Directory>


Change it to


<Directory />
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

and that's it..

Type your IP in browser and you should see the server page instead of Forbidden error.

c) Access denied Error while accessing phpmyadmin


 Access denied for user 'root'@'localhost' (using password: NO)
 

 Reason for this : This error majorly occurs when when you have mysql installed and then you installed WAMP.
                    WAMP have inbuilt MYSQL with it. but if mysql is previously installed, it uses the mysql that was previously installed
                    and that causes the issue.
                    The MYSQL with WAMP have by default no Password for "root" user and same has been defined in the config.inc.php file(C:\wamp\apps\phpmyadmin3.2.0.1)
                    But the mysql that you have already installed must be having some password and thus giving the access denied error.
                   
 To resolve this : Edit config.inc.php file
                    Search for something like $cfg['Servers'][$i]['password'] = '';

                   
                    and add the password in between the quotes.
                   

d) Unable to provide access to only specific users to phpmyadmin


Mostly it happens, there is need to allow access to some specific users only to phpmyadmin.

To accomplish this, go to wamp/alias/phpmyadmin.conf file

You should see something like this(version may vary)

<Directory "c:/wamp/apps/phpmyadmin3.2.0.1/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
</Directory>

To give access to specific IPs like to 192.168.1.7
Add the line Allow from 192.168.1.7

like

<Directory "c:/wamp/apps/phpmyadmin3.2.0.1/">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
        Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
    Allow from 192.168.1.7
</Directory>

e) Upload more than 2MB database file


By Default, php allows 2 MB file to be uploaded over the server.

But many times we need to import the database sql files having size more than 2 MB.
So to overcome this you need to edit the wamp/bin/apache/apache<version>/php.ini file

serach for "upload_max_filesize" and "post_max_size" and change there values to say 20M(now you can upload 20MB file).






That's it for now.. Hope you like it..

Comments

Popular posts from this blog

Login with Google Account using PHP / Javascript using OAuth2.0

Login with Google Account using PHP with code This post have Complete Code for Login / Sign-in  with google Account  using PHP / Javascript with oAuth2.0 Basically today we have seen almost every website needs you to register yourself before you can post or take part in any discussions to the website. But it become a tedious task to register and login to many different sites. Solution is to provide the users the option to Login with existing Google / Facebook account as almost everyone have Facebook and Google account.. In this post, I am going to explain how to integrate the Google Login / Sign in  for your website. For this,  First you need to create your Client ID, Client Secret and your developer API key. For this go to https://developers.google.com/identity/sign-in/web/sign-in Click on the button Create Project. A new window will open up. Please select Create Project / or select already created Project. It will then ask for about type of Project. Please

How To Set Up Apache Virtual Hosts on Ubuntu

How to setup Virtual Host in Ubuntu 16 / Ubuntu 18 on localhost / local machine To run the website with host on localhost(With LAMP) becomes important in many cases. This blog post will demonstrate how to achieve this. Assuming you have LAMP already installed and reading the code from (/var/www/html) Follow the simple steps below Create the code base To Create the code, simply create a directory named localweb inside /var/www/html. Create a file index.php inside localweb directory Content of index.php file <?php  echo "Local Website"; ?> Now our code base is set, so we need to configure apache Go to apache directory cd  /etc/apache2/sites-available/ Create one file named localweb.conf with content <Directory /var/www/html/localweb/>     AllowOverride All </Directory> <VirtualHost *:80>     ServerAdmin admin@localweb.com     ServerName localweb.com     ServerAlias www.localweb.com     Documen

ORCAM - Blind can read too.!!

ORCAM: The technology that was developed mainly with the aim – to help to help the visually impaired and blind regain the functionalities that were lost. Yeah. So now even visually impaired guys can get to know even the smallest written things just by pointing towards them, like the reading the book. Yes. Even those who are completely blind, can even read a book using ORCAM. SO what actually is ORCAM.????? A visual system with human like performance to help visually impaired people Here is a look towards ORCAM-See for yourself Search Results It is a simple device with a camera and earphone   that fits in the simple glasses   and uses the Text-to-speech technology to read the objects and sends the user in the voice format with the help of the earphone. The   OrCam device is able to identify thousands of objects, including the faces of loved ones, dogs, buses, newspaper text and store signs, all with the point of the finger. Its v