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

  1. What's the difference between post_max_size and upload_max_filesize ?
    Thanks in Advance !

    ReplyDelete
  2. upload_max_filesize is the limit of any single file. post_max_size is the limit of the entire body of the request, which could include multiple files

    ReplyDelete

Post a Comment

Popular posts from this blog

What is MonGoDB??

Share on Google Plus Now a Days, we are hearing a lot about MongoDB.

So, in this post I will try to briefly introduce to MongoDB.

MonGoDB is "Non-Relational, JSON, Document Store".

Explaining in detail,

Non-Relational, --> The DB we use most like SQl, Oracle are Relational DBs(RDBMS). They do have the fixed schemas, lots of tables. So Non-relational in nothing like that.

JSON : (JavaScript Object Notation) : It is basically a document with information in the form of key value pair.

for example,

{
   name:"lorem",
   address:"ipsum
}

thats it. 
A simple JSON document where name and address are key
and "lorem" and "ipsum" are corresponding values.

So, MongoDB is the Non Relational database which stores information using DOCUMENT and that document is a JSON document.

MongoDB stores collections of documents.
(Consider the above exxample as collection  "Person"  with a document)(will elaborate it later more)


Need of MongoDB:
The Databases we use…

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

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.

Download Source Code

Live Demo



For this,  First you need to create your Client ID, Client Secret and your developer API key.

For this go to https://code.google.com/apis/console/


Click on the button Create Project. A new window will open up like this :













Enter the Project name and submit on Create.

Wait for new seconds, the new page will open like this.



On the left menu, click on API & Auth and click on credentails. Then…