Showing posts with label Wamp. Show all posts
Showing posts with label Wamp. Show all posts

Friday, March 14, 2014

Add a new version of PHP to Wamp Server

To Add a new version of PHP to wamp server , Say you have php5.4.3 and you want to add a new version php5.5.8.

You have to follow these steps to be assure that you can run the new version in your wamp server :

 1. Copy the new php version folder to the php folder in Wamp/bin folder .
                       Example :
                                Wamp/bin/php/
                                                      /php5.4.3
                                                      /php5.5.8

  (Note: the first number must be attached directly to php, no space no dots) .

2.Create a new file and name it wampserver.conf in the new php folder(php5.5.8) .

 3.Copy the content of the wampserver.conf that reside in the last php version (php5.4.3) to the wampserver.conf of the new php version(php5.5.8).

4.make a copy of php.ini file in the new php version(5.5.8) folder and name it phpForApache.ini .

5. (if it is not Exist)Add the following  line to the new  phpForApache.ini :

        extension_dir = "d:/wamp/bin/php/php5.5.8/ext/" .

6. Add the following line to the end of the LoadModule section in httpd.conf file which reside in wamp/bin/apache/apache2.4.*/:

 LoadModule php5_module "d:/wamp/bin/php/php5.5.8/php5apache.dll".

 7.Also add the following  line :

;AddModule php5

(Note: these two line will be replaced by the contents in the wampserver.conf variables ,So it is not important what is written here as long as the line contain the two words "LoadModule" and "php" or "AddModule" and "php").

Friday, August 9, 2013

NetworkError: 403 Forbidden Wamp Apache css js files

"NetworkError: 403 Forbidden   Wamp Apache css js files
SyntaxError: syntax error  <!DOCTYPE html>

Sometimes the Apache server cannot load static files other than html pages like images files, script and style files . when you have this error, that means some of the server configuration rules block the loading of these file and almost it will be in the Directory directive in http.conf file. So check the apache configuration file for Directory directive - Options Method - it may be duplicated in the main configuration file and the virtual host configuration file if you have virtual hosts, or it is not set .

if you get an error "forbidden" on directory with no index file then turn on the autoindex apache module or provide an index file if you don't want to list the files in that directory.
Other cause of this problem is that ,the server cannot reach the javascript files or there is a typing error in the syntax of the javascript tag check the script tag and the src attribute .

Tuesday, May 28, 2013

Wamp Server is Not loading Postgres server Extensions php_pgsql.dll and php_pdo_pgsql.dll

It is not enough to uncomment the  relative lines in the php configuration file on Windows but Also you have to add this line to the Apache Server configuration file :

LoadFile "C:/wamp/bin/pgsql/pgsql9.2.41/bin/libpq.dll"

Change the Path to suite your configuration .

Thursday, May 23, 2013

Error displaying the error page: Application Instantiation Error (Windows 7 + Wamp server)

When startup joomla on a new php version 5.4.15 "Error displaying the error page: Application Instantiation Error" The Problem is the mysql extension is not running or not loaded by Php, you can check that by display the loaded extensions by usin this command :
$loaded_extensions = get_loaded_extensions();
echo '<pre>';
print_r($loaded_extensions);
echo '</pre>';
exit;
you will see n the resulted list only the default extensions That means the Apache server dont know where to fnd those extensions, I mean the extension_dir is not clearly configured in apache configuration file . to solve this issue go to php version folder, and find the file phpForApache.ini (on Wamp server) then write the right address to the extensions directory. like this :
extension_dir = "c:/wamp/bin/php/php5.4.15/ext/"
check again that this line is uncommented (the ; is removed). restart your server again and it will load the extensions from the right place. 

Note: When You change anything in phpForApache.ini for the php version  it must be not loaded, that means the php version thats hold this file must be not running.

Note: If you are not on Wamp Server you have to check you phpinfo() page to see where is your php.ini reside.

Friday, May 3, 2013

Wamp cannot load extensions- php5apache2_4.dll - Windows 7

Wamp is Automating every thing that's the great thing of this web server , So , If you enable the extension from the menu (Icon Tray-> Php Menu  ->Extensions) ,Wamp will un-comment the extension in your php.ini  automatically , you don't need to do anything.

Please Note : that there are three Php Initial files came with Wamp , one in Php Directory , the second in Apache->Bin Directory and the third is called phpForApache.ini and located in php directory.

We are talking here about the second file that located in Apache->Bin  folder and that file must be showed in the results of Phpinfo() function as "Loaded Configuration File " variable .

So, Don't Comment anything . wamp will do it for you , what you need to do Solve Any Problem is to check the Variable 'Extension_dir' in php.ini file , the directory must be related to the apache folder .I meant that the path to the Php extensions directory must be not  = "ext", Because that mean, the folder is inside the Apache->Bin  Folder , and that's not right . Just write the full Path to the extension Directory.

Another thing to mention here that is very important if you are going to play with wamp , when you switch the php version through the system tray menu, Wamp  will copy the phpForApahce.ini from php version directory to Apache version directory .
Then it will change  any line contain "LoadModule  And Php" with the  line from another file called "wampserver.conf" that is located in php folder which is relevant to the apache version.

Two files are  important to wamp to load php extension successfully on is the php.ini in the php directory and the other is in apache/bin directory they must include the same extension and the same extension_dir






Sunday, February 10, 2013

Wamp on Windows 7 Startup

Problem:
Localhost is running automatically on Windows 7 start up .
To Solve that Just change its Startup type from Automatic to Manual  through the services panel .
From the command prompt enter : Services.mcs
Enter
look for Wampapache and Wampmysqld  Services and change their startup type to Manual



If you want to run Wamp whenever Windows startup then change manual to Automatic

Monday, January 28, 2013

Apache 2.* Wamp Stop Working on Orange Icon

On Windows 7, Wamp server  used to run smoothly with no problems and suddenly the server stop working, if the server is ok the tray icon will be in green color, that  is sign of healthy wamp server, but now  I get only at orange color tray icon.
As usual the first thing to do in thiss case is to check the logs file to see the error message that was saved there, but another shock was there is no error message in Apache log files.

The Problem was that ,Skype is conflicting Apache because Skype use port 80 as an alternative connection port, So when Skype is started before you start apache it will use the 80 port, but if Skype is started after then port 80 will be dominated by Apache on Wamp.

What to do :
In Skype from the Main menu choose Tools then Options then Advanced and uncheck the chckbox that is titled by  "use port 80 and 443 as alternatives for incoming connections"

Happy Wamping.

Tuesday, January 22, 2013

Apache 2.* only serve the first virtual host - Windows 7 + WAMP

This is a problem that cost me 3 days googling and searching every where without any hints or clues to the way that I should take to solve this problem.
But It was very easy if you try to stop thinking that google can solve all of yourproblems , just relax and try to solve it by yourself.
That's what I did , the server was running great for more than 6 months now, and suddenly I cannot reach my virtual hosts.
My  $1 million dollar advice to any one face such a problem or any other one is "First Check Log files".
What I had there is 


[error] (OS 11001)No such host is known.  : Could not resolve host name

And that means the system don't know how to reach the name domain that you write in the address bar. So the Problem was in Domain Resolution. that lead to host file.

When I checked the host file I cannot find any problem. All virtual hosts had their right IP addresses "127.0.0.1".
But Apache Said he cannot reach this file , means  there are security rules prevent apache from opening this file. 
Yes, It is a secured file by windows and to allow any application to use this file you have to give the application the right permissions. So Apache on windows to be able to read host file and run virtual host must be "Run As Administrator". That is it .

Long Road for Dummies like me , but a very good tutorial to know that I can solve things my self.