Category Archives: WAMP Developer Server

Enabling Zend Guard Loader for PHP 5.4, 5.3, or Zend Optimizer for PHP 5.2

Some PHP scripts and apps require the Zend Guard Loader or Zend Optimizer to be able to run, as their code has been encoded either to obfuscate reverse-engineering or to be licensed.

Normally, to install and use Zend Guard Loader or Zend Optimizer (to decode obfuscated PHP code, or run licensed scripts) you would need to: locate and download the proper package, match it to your PHP version and build type, and configure php.ini to set up and load the extension. Otherwise, an error message similar to “Zend Optimizer | Zend Guard Loader not loaded or installed” will be shown, such as this one:

PHP extension “Zend Optimizer” or “Zend Guard Loader” is not loaded. The required run-time support is not installed or properly configured to run PHP scripts encoded by Zend Encoder and Zend Guard.

Installing and enabling Zend Guard Loader and Zend Optimizer is made easy with WampDeveloper Pro, which includes the last good version of each Loader, their full configuration, and their matching PHP versions and types:

  1. Zend Guard Loader for PHP 5.3 FCGI.
  2. Zend Optimizer (Loader) for PHP 5.2 Regular.

Zend Guard Loader for PHP 5.4 and 5.3 FCGI

The last version of Zend Guard Loader is v3.3, and it was released for PHP 5.4 and 5.3 FCGI only (e.g., there is no “Thread Safe” build for regular PHP).

1. In WampDeveloper’s Components Tab, click the link to download the latest PHP 5.4 or 5.3 FCGI version, and extract the ZIP into folder:

2. Open and edit (via notepad) PHP 5.4′s or 5.3′s php.ini file:

Near the bottom, find section “[ZendGuardLoader]“, un-comment it as such:


Save file.

3. In WampDeveloper's Components Tab, select PHP's 5.4 and 5.3 Subscription Channel:

Channel:  Stable
Bits:     32

Then check-mark to use the proper Apache, PHP (FCGI), and MySQL versions. And click: "Switch To Selected Versions".

4. After starting Apache, check the http://serverhost/phpinfo.php page:

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.3.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend Guard Loader v3.3, Copyright (c) 1998-2010, by Zend Technologies


Zend Guard Loader

Zend Guard Loader    enabled
License Path         no value
Obfuscation level    3

Zend Optimizer (Loader) for PHP 5.2

The last version of Zend Optimizer (Loader) is v3.3.3, and it was released for PHP 5.2 only (e.g., there is no "Not Thread Safe" extension for FCGI PHP).

1. In WampDeveloper's Components Tab, click the link to download the latest PHP 5.2 Regular version, and extract the ZIP into folder:

2. Open and edit (via notepad) PHP 5.2's php.ini file:

Near the bottom, find section "[Zend Optimizer]", it should already be un-commented as such:

[Zend Optimizer]
; this will make Apache crash/unstable if used with APC

Save file (if you made any changes).

3. In WampDeveloper's Components Tab, select PHP 5.2's Subscription Channel:

Channel:  Legacy-PHP52
Bits:     32
PHP Type: Regular

Then check-mark to use the proper Apache, PHP (FCGI), and MySQL versions. And click: "Switch To Selected Versions".

4. After starting Apache, check the http://serverhost/phpinfo.php page:

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
    with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies


Zend Optimizer

Optimization Pass 1     disabled
Optimization Pass 2     disabled
Optimization Pass 3     disabled
Optimization Pass 4     disabled
Optimization Pass 9     disabled
Zend Loader             enabled
License Path            no value
Obfuscation level       3

Zend Optimizer's "optimization" has been disabled, as we only want it's "decoding" (loader) part.

Display Country Stats In Awstats By Using GeoIP

There are two different ways to get country information displayed in Awstats.

Use Reverse DNS Loopkups

The simplest way to display country stats in Awstats is to enable reverse DNS lookups for each IP address, which Awstats can attempt to parse the country info out of.

This method has two problems, the reverse DNS loopkup: 1) will greatly slow down the update process (5x-10x), and 2) is not very accurate (you’ll get allot of “unknowns”).

1. Edit your website’s awstats configuration file (via Notepad):

Update -

# Possible values:
# 0 - No DNS Lookup
# 1 - DNS Lookup is fully enabled
# 2 - DNS Lookup is made only from static DNS cache file (if it exists)
# Default: 2

2. Delete old awstats data files:

3. And in URL /stats, click to “Update now”.

Use AWStats GeoIP Plugin

To get more accurate and faster country results in Awstats, use its GeoIP plugin…

1. Install the Perl “Geo::IP::PurePerl” module:

Open command-line and execute -

perl -MCPAN -e shell;
install Geo::IP::PurePerl

2. Download GeoIP database:

Extract/place GeoIP.dat file into folder -

3. Update awstats configuration file for website:

Edit your website’s awstats configuration file (via Notepad) -

Load plugin GeoIP (uncomment and update line) -

LoadPlugin="geoip GEOIP_STANDARD C:/WampDeveloper/Tools/GeoIP/GeoIP.dat"

Save file.

4. Delete old awstats data files:

5. And in URL /stats, click to “Update now”.

You will have to periodically re-download the database file (which can be automated via Windows Task Scheduler and wget). Also, it’s the free version of MaxMind’s GeoIP offering, how often it’s updated is unknown.

* We are using “Geo::IP::PurePerl” instead of “Geo::IP” because the later depends on additional GeoIP C libraries that are not provided (extra steps would need to be taken to build/compile them).

How To Access Local Website from Internet

The sites work fine on local host, but not on the internet.

Most WAMP Servers such as WampDeveloper Pro accept all incoming connections by default. Even when a request comes in for an unknown website (i.e., the domain name or IP address is not assigned to any website), Apache is configured to return the default website – localhost (the 1st Virtual Host loaded).

If you are unable to make a connection from the internet to your website, then the request did not reach Apache.

When this happens, Chrome (browser) displays “This webpage is not available” message, and clicking on Details shows Error code: ERR_CONNECTION_TIMED_OUT


IE (browser) produces a more generic “Internet Explorer cannot display the webpage” message, without any specific error code…


The most common cause of this are:

  1. Local Firewall software such as McAfee, Norton, and Windows Firewall blocking incoming port 80 and 443 requests.
  2. Bad or missing port-forward rules in the Router.
  3. Router settings blocking internet traffic via internal firewall or configuration.
  4. Network firewall or appliances dropping incoming port 80 and 443 requests.
  5. The ISP blocking incoming port 80 and 443 requests.
  6. Changing IPs (both the LAN IP and Public IP), and/or bad DNS records for domains.
  7. Within LAN or Corporate Network, local network proxy settings that are taking the domain-name resolve to somewhere else.

To troubleshoot the issue -

1. Delete all auto-created Windows Firewall rules for “Apache” or “HTTPD”. Create general rules to open port 80 and 443 TCP. Once Apache is started again, when notified/prompted by the firewall, click to unblock Apache.

Also turn all other firewall and anti-virus software off when testing everything… McAfee, Norton, Kaspersky, etc.

2. Access the Router via URL: http://lan-ip.of.router/, and once in, go over it’s setting to make sure it’s not blocking internet traffic.

Then remove all port-forwarding rules, and create the proper rules to forward all WAN:80 and WAN:443 traffic (internet requests) to LAN:80 and LAN:443 (the LAN IP of server).

The Public IP will be assigned to the first device connected to the ISP (which is usually the Router), and that is the reason why the Router needs the proper port-forwarding rules – so that it can forward incoming internet traffic requests to the proper LAN system.

3. When testing this, bypass DNS and domain-names by using the IP address directly:

A) Assigning both the Public IP address and LAN IP address as Domain Aliases of a website.
B) Turning off Redirects from Aliases to Primary Domain Name.
C) And just use the Public IP address, as URL: http://public.ip.address/, to access your website.

4. Verify that you are using the right Public IP and LAN IP addresses. These IPs can change time to time.

5. Also, test the connection from another LAN system via URL:http://lan.server.ip.address/ and http://computer-name/. If this is not working, there is an issue within the local network.


Being able to successfully ping the Public IP will tell you nothing about the situation… Pings work differently from HTTP connections. If a ping comes back, all that signifies is that the Router settings have pings enabled, and your Router is able to ping you back.

If Apache is running, then it was successful in binding to port 80 and 443, and it’s not a problem with another web-facing service or application (like Skype) taking these ports.

Enabling Online and Internet Access of Websites For WAMP Server

Accessing Websites on a Local Network (LAN) Web Server

Limiting Access To Apache’s VirtualHosts To Local Network (LAN) Only

To only allow connections to websites from machines that are on your local network (LAN), while blocking everyone coming from the Internet, edit the website’s HTTP and SSL VirtualHost files and update the website’s <Directory> configuration…

From – All Access:

Options All

AllowOverride All

Order allow,deny
Allow from all

To – LAN Access Only:

Options All

# All directives except Limit directives (allow, deny, order)
AllowOverride AuthConfig FileInfo Indexes Options=All

Order deny,allow
Deny from all

Allow from localhost

# IPv4
Allow from       # IPv4 Loopback Addresses
Allow from    # IPv4 Link-local Addresses
Allow from        # IPv4 Normal LAN Address Space
Allow from     # IPv4 Normal LAN Address Space
Allow from    # IPv4 Normal LAN Address Space

# IPv6
# For Apache 2.4 and up only
<IfVersion >= 2.4>
Allow from ::1/128           # IPv6 Loopback Addresses
Allow from fe80::/10         # IPv6 Link-local Addresses
Allow from fc00::/7          # IPv6 Unique Local Addresses (LAN Space)	

Changing AllowOverride All to remove Limit directives (allow, deny, order) restricts further .htaccess files from overriding the above Allow from configuration.

To use the IfVersion directive this module should be loaded by Apache -

LoadModule version_module modules/

To use the allow, deny, and order directives on Apache 2.4 this module should be loaded -

LoadModule access_compat_module modules/

Private Network Addresses

Running PHP Scripts Outside of DocumentRoot

In some WAMP configurations, PHP execution is only enabled under a specific root folder and given path (instead of for any *.php filename under any folder or path).

For example, under WampDeveloper Pro, PHP is enabled for all *.php files under the path of:

There are two ways to enable the execution (running) of PHP scripts outside of a website’s DocumentRoot (\webroot) folder…

* In this example we’ll enable the running of PHP scripts in folder: D:\Folder\path\

JunctionPoint Into DocumentRoot

The preferred way to enable PHP in an outside folder is to keep the existing configuration (by not adding anything to it), and creating a “JunctionPoint” to link…

1. A folder inside a website’s DocumentRoot:

2. Into the PHP web-app/script folder:

Open the command line (with elevated privileges) and execute:
mklink /j C:\WampDeveloper\Websites\\webroot\path D:\Folder\path

This will create folder C:\WampDeveloper\Websites\\webroot\path and link it to D:\Folder\path. The former will have all the proper configurations enabled (from the base WAMP configuration), and with all the files/folders of the later.

* The only limitation here is that the target folder needs to be a local volume (e.g., can’t be a networked drive).

Enable PHP Directly For a Specific Folder

The second option is to directly enable PHP execution in the specific folder by placing this into a website’s VirtualHost, or into the global configuration (included into httpd.conf via Config\Apache\extra\wampd-custom.conf):

Alias /path/ "D:/Folder/path/"

<Directory "D:/Folder/path">
    Options All
    AllowOverride All
    Order allow,deny
    Allow from all

    # PHP-FCGI
    <IfModule mod_fcgid.c>        
        AddHandler fcgid-script .php .php4 .php5
        Options +ExecCGI +FollowSymLinks

        FcgidWrapper "C:/WampDeveloper/Components/Php/php-cgi.exe" .php virtual
        FcgidWrapper "C:/WampDeveloper/Components/Php/php-cgi.exe" .php4 virtual
        FcgidWrapper "C:/WampDeveloper/Components/Php/php-cgi.exe" .php5 virtual

    # Apache 2.2 and 2.4 / PHP5
    <IfModule mod_php5.c>
        AddType text/html .php .phps
        AddHandler application/x-httpd-php .php
        AddHandler application/x-httpd-php-source .phps

    # Apache 2.2 / PHP 4.4
    <IfModule php4_module>
        AddType text/html .php .phps
        AddHandler application/x-httpd-php .php
        AddHandler application/x-httpd-php-source .phps

    # Apache 2.0 / PHP 4.4
    <IfModule sapi_apache2.c>
        AddType text/html .php .phps
        AddHandler application/x-httpd-php .php
        AddHandler application/x-httpd-php-source .phps

* The limitation with this option is that while this will enable PHP execution in the specific folder, this folder will not inherit any other configuration of the base WAMP setup.

Installing and Using ImageMagick with Imagick PHP Extension (php_imagick.dll) on WAMP

The php_imagick extension enables WAMP servers such as WampDeveloper Pro to create, edit, convert, and/or manipulate images via PHP using the ImageMagick software on Windows.

WampDeveloper Pro comes integrated with both the ImageMagick package and the Imagick PHP extension.

To enable the Imagick PHP Extension in WampDeveloper Pro:

1. Open file php.ini -

2. Near the end of php.ini, locate the ImageMagick section -


3. Un-comment the load line for this extension (remove the ‘;’ character from the beginning of the line) -


4. Save file. Restart Apache.

Afterwards, Imagick will be loaded by PHP and you can verify this via phpinfo.php…


5. Test imagick:

A. Create a scaled thumbnail image…


// if full path is not specified, will look for file in Apache's folder.

$im = new imagick('C:\WampDeveloper\Websites\\webroot\imagick\pic.jpg');

// resize by 200 width and keep the ratio
$im->thumbnailImage(200, 0);

// if full path is not specified, file will end up in Apache's folder.

// write to disk

echo 'Image Thumbnail Created.';


B. Covert JGP image to PNG image format…


$image = 'C:\WampDeveloper\Websites\\webroot\imagick\pic.jpg';

// a new imagick object
$im = new Imagick();

// ping the image

// read the image into the object

// convert to png

// write image to disk

echo 'Image Converted.';


Connecting PHP to MS SQL Server

php_sqlsrv.dll is PHP’s Database Driver for MS SQL Server, that has replaced php_mssql.dll (which no longer exists with PHP 5.3 and above).

While the php_sqlsrv API is not the same as the php_mssql API, php_sqlsrv can be used through php_pdo_sqlsrv which provides the common PDO Database interface that can access MS SQL Server.

There is 1 official build of php_sqlsrv.dll by Microsoft that is provided for PHP 5.3. And several unofficial builds of php_sqlsrv.dll for PHP 5.6, 5.5, 5.3 (32 bit and 64 bit).

PHP 5.5 Driver for MS SQL Server

Download the unofficial builds maintained here:

In the OneDrive folder, right-click on file “” and select “Download”.

Inside of file, extract these files out:





* The above PHP versions are WampDeveloper Pro’s (v5.1.0.1) latest PHP 5.5 releases (regular PHP and FCGI-PHP).

Microsoft’s PHP 5.3 Driver for MS SQL Server

Download the official build maintained here:

Download file:

This file is not really an EXE (it’s a compressed CAB file), and if you try to run it Windows will display error message: “sqlsrv30.exe is not a valid win32 application”.

You will need to open (not run) SQLSRV30.EXE with either of these un/compression programs: WinRar, or 7-Zip (I use 7-Zip myself, it’s free and open source).

Inside of file SQLSRV30.EXE, extract these files out:





* The above PHP versions are WampDeveloper Pro’s (v5.1.0.1) latest PHP 5.3 releases (regular PHP and FCGI-PHP).

Then via Components Tab, switch WampDeveloper from using Channel: Current (Apache 2.4 + PHP 5.5 + MySQL 5.6) to Stable (Apache 2.2 + PHP 5.3 + MySQL 5.5)…

Load php_sqlsrv.dll

Rename the files under all PHP versions to:

Edit file php.ini, and insert the loading of “php_sqlsrv.dll”…


Save file. Restart Apache.


“Microsoft Drivers for PHP for SQL Server” project

“Update For PHP 5.5″ discussion

“Data Developer Center SQL Server Driver for PHP” page

“Accessing SQL Server Databases from PHP”

Unable to load or find PHP extension php_intl.dll

PHP says it can’t find extension php_intl.dll, yet file "php_intl.dll" does exist in the specified location!…

PHP Startup: Unable to load dynamic library ‘C:/wamp/path/to/php/ext/php_intl.dll’ – The specified module could not be found.

This is a very common issue, especially under PHP 5.5, and can easily be fixed.

To find out why PHP cannot load extension php_intl.dll, open the command line, change to WAMP’s PHP directory, and test the php_intl.dll dependencies (i.e., the other DLL files it needs):

cd  \WampDeveloper\Components\Php
deplister.exe ext\php_intl.dll

This is a list of all the DLL files php_intl.dll must load itself, before PHP can load it:

# Core PHP DLL

# International Components for Unicode (ICU) libraries - Unicode and Globalization support

# Microsoft VC++ 2012 Runtime libraries - common functions required by C and C++ programs

# Core Windows DLL

On a system with this issue, either the “ICU” or the “VC++ Runtime” DLL files will not be found (i.e., shown as “NOTFOUND” instead of “OK” in the above output).

And when php_intl.dll is not able to find and load these dependencies, PHP outputs:

"The specified module could not be found."

Here is how to fix the issue and load php_intl.dll:

1. Make sure the PHP directory path is included in the system’s PATH environmental variable so this set of provided/included ICU DLLs, that php_intl.dll depends on, are found:

icuuc51.dll, icuin51.dll, icuio51.dll

* WampDeveloper Pro already includes PHP’s directory in PATH, but some other WAMP distributions do not.

2. Install the Microsoft VC++ 2012 Runtime Redistributable that will provide these VC11 runtime DLLs that php_intl.dll depends on (PHP 5.5 is built with VS.NET 2012):

MSVCR110.dll, MSVCP110.dll

Visual C++ Redistributable for Visual Studio 2012 Update 4

Make sure to install the 32 bit (x86) version if you are using a 32 bit PHP build: vcredist_x86.exe

* Unlike PHP 5.5, PHP 5.3 is built with VS.NET 2008 (VC9), and depends on “Visual C++ Redistributable for Visual Studio 2008″ which provides runtime DLLs: MSVCR90.dll, MSVCP90.dll

Removing Sender’s IP Address From Email’s Received: From Header

When sending an email, Sendmail and other SMTP servers, will log your originating device’s: name (hostname or computer name), IP address, and IP’s reverse DNS lookup, into the first “Received: from” Header line…

Received: from (ip-address.reverse.lookup [ip.address])

This is a problem because:

  1. It’s sensitive information that contains your location.
  2. It can further contain meta-data about your reader (ex: Outlook, Windows Live Mail, Mail App, Mozilla Thunderbird).
  3. Spam tools will detect a Residential IP address which will prevent email delivery.

The solution to hide the client’s (sender’s) IP address is to redefine the SMTP server’s use of RECEIVED_HEADER.

The standard definition of this header can be found in file:

define(`_REC_AUTH_', `$.$?{auth_type}(authenticated')
define(`_REC_FULL_AUTH_', `$.$?{auth_type}(user=${auth_authen} $?{auth_author}author=${auth_author} $.mech=${auth_type}')
define(`_REC_HDR_', `$?sfrom $s $.$?_($?s$|from $.$_)')
define(`_REC_END_', `for $u; $|;
define(`_REC_TLS_', `(version=${tls_version} cipher=${cipher} bits=${cipher_bits} verify=${verify})$.$?u')
define(`_REC_BY_', `$.by $j ($v/$Z)$?r with $r$. id $i$?{tls_version}')
define(`confRECEIVED_HEADER', `_REC_HDR_
        _REC_AUTH_$?{auth_ssf} bits=${auth_ssf}$.)

To strip out all private info (senders’s/client’s IP address) of the initial client connection, you would basically remove that entire connection’s info (and also of all the connections before it), and make it look like the email originated from the SMTP server itself…

Edit file:

define(`confRECEIVED_HEADER',`by $j ($v/$Z)$?r with $r$. id $i; $b')dnl

Then rebuild and restart sendmail:

[root@private mail]# m4 /etc/mail/ > /etc/mail/
[root@private mail]# service sendmail restart


I’ve been doing this for YEARS without any issues whatsoever to be able to send out emails from my PC (using Outlook and Windows Live Mail) to my clients without triggering spam filters, and to prevent privacy leaks.

Using phpMyAdmin to Create a MySQL Database, User, Password

Make sure Apache and MySQL are running, and access phpmyadmin via URL:

Login with:

Username: root
Password: (leave it blank, it's not set by default)

Click ‘Go’.

* User “root” under WampDeveloper Pro is restricted to local network access in multiple ways, so setting a password is not absolutely necessary.

Create a database:

  1. Click on the ‘Databases’ tab.
  2. Specify a Database name.
  3. Leave everything else as-is (don’t select a collation).
  4. Click ‘Create’.

Create a user:

  1. Click on that database.
  2. Click on its ‘Privileges’ tab.
  3. Click in ‘New’ group, ‘Add user’.
User name ('Use text field'): username-here
Host (select 'Use text field'):
Password ('Use text field'): password-here
Re-type: password-here

Leave everything else as-is:

'Database for user' group: Grant all privileges on database "database-name".
'Global privileges' group: None

* Don’t select any “Global” privileges/permissions, this user only needs all privileges/access on that specific database, and not on all the databases under MySQL.

Click ‘Go’.

Whenever you need to specify this info when you install or configure a web-app or script, make sure to enter the db and user info exactly as above, with “Host” as and not as “localhost”.