-
Notifications
You must be signed in to change notification settings - Fork 0
Devbox installation guide
- Install the git client from here.
You can perform this task either from Git Bash or from Git GUI:
From the Git GUI, use the following URL:
https://YourGitHubLogin@github.com/WindowsAzure/azure-sdk-for-php.git
From Git Bash, type the following command
git clone -b dev https://YourGitHubLogin@github.com/WindowsAzure/azure-sdk-for-php.git
[deepakv: there would be users who already have php installed like by using webpi which install non thread safe version of php, so this section could be skipped by those users. It could also be that this section might confuse the user that this sdk would only work with thread safe version??]
You need the thread safe version of PHP to be able to run the unit tests. Development is currently done using PHP v5.3.
Download:
-
MSI: make sure to select the
Fileinfo
andXSL
extensions when prompted by the installer as they are not selected by default. -
.zip: you should get a copy of
go-pear
because sometimes it's not included with the download. You may need to manually install theFileinfo
andXSL
extensions. During installation, please choose a target path that doesn't contain spaces, as this will prohibit some scripts to run correctly on Windows.
This document assumes that PHP is installed in C:\PHP
The complete instruction on configuring PHP on your machine is available here at this link.
In practice, PHP configuration comprises the following steps:
- set cgi.force_redirect =0; search cgi.force_redirect in php.ini, uncomment cgi.force_redirect by removing ; at the begging of the line, and set the value to 0.
- set cgi.fix_pathinfo, search cgi.fix_pathinfo in php.ini, uncomment cgi.fix_pathinfo by removing ; at the beginning of the line.
- set fastcgi.impersonate = 0, search fastcgi.impersonate in php.ini, uncomment fastcgi.impersonate by removing ; at the beginning of the line, and set the value to 0.
- disabling fastcgi.logging, search fastcgi.logging in php.ini, uncomment fastcgi.logging by removing ; at the beginning of the line, set the value to 0.
- set
date.timezone = "America/Los_Angeles"
- enable
extension=php_mbstring.dll
From PHP source directory, type [deepakv: I didn;t have go-pear may be a clue on where to get it would help?]
go-pear.bat
- select system for the system|local
- type enter for all the questions.
- when go-pear.bat is completed, a new file
C:\PHP\PEAR_ENV.reg
will be created. Double click this file to register it. - upgrade PEAR to the latest version by executing this command:
pear upgrade PEAR
Note: if you faced any problem first thing to do is to execute these commands:
pear clear-cache
pear config-set preferred_state beta
If that didn't work then you should tackle your mind and figure out the reason!
Requires libraries are:
-
HTTP_Request2:
pear install http_request2
-
Mail_Mime:
pear install mail_mime
-
Mail_mimeDecode:
pear install Mail_mimeDecode
Optional libraries are:
-
PEAR_PackageFileManager2:
pear install PEAR_PackageFileManager2
-
pear channel-discover pear.pirum-project.org
pear install pirum/Pirum
Azure SDK PHP build include PHP documentation, unit testing and more. It is driven by ANT build system.
PHP unit test suite depends on properly installed xDebug, the correct configuration of TMG client and the right Azure account credential. For xDebug installation, please refer to xDebug installation page
The full installation manual for ant is available at Ant installation page
The ant can be download from a mirror on this page
Installation bottom line:
- Extract the Ant to a place on your disk, e.g. C:\ant
- Add the bin directory to your path. (add C:\ant\bin to your PATH)
- Set the ANT_HOME environment variable to the directory where you installed Ant. On some operating systems, Ant's startup scripts can guess ANT_HOME (Unix dialects and Windows NT/2000), but it is better to not rely on this behavior.
PHP QA tools include the unit test, checkstyle, code analysis and many other tools that is useful to ensure high quality PHP coding standard.
pear config-set auto_discover 1
pear install pear.phpqatools.org/phpqatools pear.netpirates.net/phpDox
The source code of Autoload is available at the this website, however, the installation can be completed in PEAR alone. The following three command will help you install Autoload.
pear channel-discover pear.netpirates.net
pear channel-discover components.ez.no
pear install theseer/Autoload
if you did that and faced error like this:
theseer/DirectoryScanner requires PHP extension "fileinfo"
theseer/Autoload requires package "theseer/DirectoryScanner" (version >= 1.1.0)
No valid packages found
This is because fileinfo module hasn't been enabled. Make sure that php_fileinfo.dll
reside in ext directory. If php_fileinfo.dll
doesn't exist in ext directory, please download the zip file, and manually copy php_fileinfo.dll
to the ext directory.
The package page is in this link and below are installation steps:
pear channel-discover pear.phpdoc.org
pear install phpdoc/phpDocumentor-alpha
This tool is used by PHP Documentor to generate class diagram. Install it from here
Ensure that the following bat files reference the correct path to php.exe within them:
- pdependent.bat
- phpab.bat
- phpcb.bat
- phpcpd.bat
- phpdoc.bat
- phploc.bat
- phpmd.bat
- phpunit.bat
pear channel-discover pear.php-tools.net
pear install pat/vfsStream-alpha
The binary of xDebug can be found here, please find one according to your machine's configuration.
The unit test requires authenticated access of Windows Azure, a few environment variables need to be configured on the dev box to enable unit test to get authorized properly.
The storage service unit tests use the following environment variables:
AZURE_STORAGE_ACCOUNT
: name of the storage account used.
AZURE_STORAGE_KEY
: name of the storage account used.
The Service Management unit tests use the following environment variables:
SERVICE_MANAGEMENT_SUBSCRIPTION_ID
: the subscription id.
SERVICE_MANAGEMENT_CERTIFICATE_PATH
: path to an already added certificate to SERVICE_MANAGEMENT_SUBSCRIPTION_ID
.
The \ sign in the path need to be escaped. For example c:\certificate\testCert.pem should be c:/certificate/testCert.pem .
The Service Bus unit tests use the following environment variables:
SERVICE_BUS_NAMESPACE
: The name space of the service bus.
WRAP_AUTHENTICATION_NAME
: The user name of the WRAP service.
WRAP_PASSWORD
: The password of the WRAP service.
To to have these credentials you just need Windows Azure subscription Id which will let you:
- Create storage service (
AZURE_STORAGE_ACCOUNT
andAZURE_STORAGE_KEY
) - Add management certificate to this subscription then use it is *.pem path. (
SERVICE_MANAGEMENT_CERTIFICATE_PATH
)
To add a management certificate read more about Managing Certificates in Windows Azure
If you do not know what is your team Sandbox subscription Id , contact Amit Sharma Sharma.Amit@microsoft.com
using cmd.exe, navigate to the PHP SDK project directory, type ant
Download Java Runtime from here and install. For 32 bit operating system, install jdk-7u3-windows-i586.exe, for 64 bit operating system, install jdk-7u3-windows-x64.exe.
Netbeans is our preferred php editor you can pick up anything that you like. Download NetBeans full version from here and install following the instruction. This version of Netbeans has dependency of Java Runtime, as a result, please make sure JDK with version number > 1.6 installed properly.
- When I type
ant
the build fail inphpunit
task without specifying any errors :(
- Make sure that you've installed all required libraries and PHP extensions.
- Make sure that you've added the environment variables and they are reflected in the cmd or NetBeans.