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).
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
Post a Comment