Showing posts with label WAMP. Show all posts
Showing posts with label WAMP. Show all posts

Saturday, June 16, 2018

How to upgrade PHP 7.2.6 on WAMP 3.0.6 server?

Software Required
- WAMP 3.0.6
- PHP 7.2.6

In the development stage, upgrading of PHP to support new library or functionality is unavoidable. WAMP has been used for my project development, however, PHP 7.2.6 doesn't exists in the WAMP 3.0.6. Below are the steps that I performed to import PHP interpreter into my WAMP container.

PHP installation steps
  • Download PHP from https://windows.php.net/download#php-7.2
  • Unzip the PHP zip file into "php7.2.6" folder and copy into "D:\wamp64\bin\php" folder.
  • Copy wampserver.conf from "D:\wamp64\bin\php\php5.6.25" to "D:\wamp64\bin\php\php7.2.6"
  • Browse to "D:\wamp64\bin\php\php7.2.6" folder, rename "php.ini-development" to "php.ini.
  • Alter php.ini by changing the new configuration as shown below
extension_dir = "d:/wamp64/bin/php/php7.2.6/ext"
upload_tmp_dir ="d:/wamp64/tmp"
error_log ="d:/wamp64/logs/php_error.log"
  • Alter the extension section at php.ini 
extension=php_bz2.dll
extension=php_curl.dll
extension=php_fileinfo.dll
extension=php_gd2.dll
extension=php_gettext.dll
extension=php_gmp.dll
extension=php_intl.dll
extension=php_imap.dll
;extension=php_interbase.dll
extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_exif.dll
extension=php_mysqli.dll
;extension=php_oci8_12c.dll  ; Use with Oracle Database 12c Instant Client
;extension=php_odbc.dll
extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll

; The MIBS data available in the PHP distribution must be installed.
; See http://www.php.net/manual/en/snmp.installation.php
;extension=php_snmp.dll

extension=php_soap.dll
extension=php_sockets.dll
extension=php_sqlite3.dll
;extension=php_tidy.dll
extension=php_xmlrpc.dll
extension=php_xsl.dll
;extension=php_com_dotnet.dll
;extension=php_dba.dll
;extension=php_enchant.dll
;extension=php_ftp.dll
;extension=php_phpdbg_webhelper.dll
;extension=php_sodium.dll
;extension=php_sysvshm.dll
;extension=php_zend_test.dll
  • Duplicate php.ini file and save it as phpForApache.ini.
  • Alter wampserver.conf located at "D:\wamp64\bin\php\php7.2.6" folder
$phpConf['apache']['2.4']['LoadModuleName'] = 'php7_module';
$phpConf['apache']['2.4']['LoadModuleFile'] = 'php7apache2_4.dll';
$phpConf['apache']['2.4']['AddModule'] =  '';
  • Launch wampserver manager, browse to "PHP" > "Version" menu, version 7.2.6 option is ready for selection. 
  • After select "7.2.6" menu and wamp manager has been restarted, browse to the site, PHP version 7.2.6 is displayed.


Tuesday, February 11, 2014

Enable SSL on WAMP server and error encountered

In order to get my WAMP server to support SSL, below are the steps to configure

1. Open httpd.conf that located at [WAMP_HOME]\bin\apache\Apache2.4.4\conf

Uncomment line as described below

LoadModule ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf
2. Open php.ini that located at [WAMP_HOME]\bin\php\php5.4.12

Uncomment line as described below

extension=php_openssl.dll
3. Open httpd-ssl.conf that located at [WAMP_HOME]\bin\apache\Apache2.4.4\conf\extra, edit the parameter as described below

<VirtualHost _default_:443>
#   General setup for the virtual host
DocumentRoot "c:/wamp/www"
ServerName localhost:443
ServerAdmin admin@example.com
ErrorLog "[WAMP_HOME]/logs/apache_ssl_error.log"
TransferLog "[WAMP_HOME]/logs/access_ssl.log"
</VirtualHost>
SSLCertificateFile "[CERTIFICATE_FILE]"
SSLCertificateKeyFile "[CERTIFICATE_KEY_FILE]"
SSLCertificateChainFile "[CERTIFICATE_CHAIN_FILE]"
4. Restart WAMP services, encountered the WAMP service icon is displayed as brown color and unable to start.


5. Open DOS command and change to directory [WAMP_HOME]\bin\apache\Apache2.4.4\bin. Type command to cross check the Apache configuration file

 httpd -t
Encountered error as described below is displayed

AH00526: Syntax error on line 76 of C:/wamp/bin/apache/Apache2.4.4/conf/extra/ht
tpd-ssl.conf:
SSLSessionCache: 'shmcb' session cache not supported (known names: ). Maybe you
need to load the appropriate socache module (mod_socache_shmcb?).
Open httpd.conf, uncomment the line as described below

LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
Type command to cross check the Apache configuration file

 httpd -t
Encountered error as described below is displayed

(OS 3)The system cannot find the path specified.  : AH02297: Cannot access direc
tory 'C:/Apache24/logs/' for log file 'c:/Apache24/logs/ssl_request.log' defined
 at C:/wamp/bin/apache/Apache2.4.4/conf/extra/httpd-ssl.conf:250
AH00014: Configuration check failed
Open httpd-ssl.conf, change the custom log directory to point to correct directory.

CustomLog "[WAMP_HOME]/logs/ssl_request.log" \
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
Restart WAMP services, you should be able to start your Apache Web Server. Your SSL has been enabled.

Thursday, August 29, 2013

Issue encounter and simple note on CakePHP 2.3.9 & WAMP 2.4 exploration

How to disable debug mode on cakephp? (Please refer to the selected red rectangle)



Steps to resolve
1. Open core.php located at "[WAMP_INSTALL_PATH]\app\config".
2. Edit debug value to "0" and deploy to the server
<?php
    Configure::write('debug', 0);
?>
3. Deploy to the server, the debug mode will be disabled.

How to resolve "Forbidden You don't have permission to access / on this server." error message when access the new installed WAMP server version 2.4?

Description
Install a new WAMP server and when access the web server using the assigned IP address through browser, "Forbidden You don't have permission to access / on this server." error message is displayed.

When using localhost/127.0.0.1 in the local machine to access the WAMP server, the default WAMP page is displayed.

Steps to resolve
1. Edit https.conf which located at "[WAMP_INSTALL_PATH]\bin\apache\Apache2.4.4\conf", edit the configuration as shown below
<Directory "[WAMP_INSTALL_PATH]/www">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order Deny,Allow
    Allow from all
</Directory>

2. Make sure port 80 in Window 2008 firewall  is opened.
- Launch "Windows Firewall with Advanced Security" screen
- Right click "Inbound Rules" and select "New Rule..." menu
- Select "Port - Rule that controls connections for a TCP or UDP port", click "Next" button
- Select "TCP" type and enter "80" for "Specific local ports", click "Next" button
- Select "Allow the connection" and click"Next" button
- Check "Domain", "Private" and "Public" checkbox and click on "Next" button
- Enter "Name" and "Description" value and click on "Finish" button.

3. Restart WAMP server, WAMP index page will be displayed.

How to redirect all the visitor's request to a particular subdirectory?

Description
When came to a requirement to redirect all visitor request to a particular subdirectory, for example /myapp/ in your PHP web application, normally I will use Apache rewrite feature to redirect all the request.

Steps to resolve
1. Edit httpd.conf and uncomment "LoadModule rewrite_module modules/mod_rewrite.so"
2. I have enable the virtual host configuration, add in the rewrite engine as described below

<VirtualHost *:80>
 ServerName [SERVER_NAME]
 DocumentRoot "C:/wamp/www"
        ErrorLog "c:/wamp/logs/apache_error.log"
        CustomLog "c:/wamp/logs/access.log" common
 RewriteEngine on
 RewriteRule ^/$ /[MY_APP_DEFAULT_FOLDER]/ [R]
</VirtualHost>
3. Rewrite your Apache web server.