-
-
Notifications
You must be signed in to change notification settings - Fork 576
Build on Windows
This page provides step by step instructions on how to build PHP Desktop Chrome from sources.
Table of Contents generated with DocToc
- Requirements
- Download PHP Desktop sources
- Download CEF sources / prebuilt binaries
- Build cefclient and copy CEF files to phpdesktop
- Download PHP binaries
- Build phpdesktop-chrome project
These instructions are for building "chrome57" branch.
Requirements:
- Visual Studio 2015 Community Edition with Update 3
- Windows SDK 10.0.14393
Clone git repository.
If you would like to use CEF prebuilt binaries then go to Spotify Automated CEF Builds. You have to download CEF for the same branch and revision that phpdesktop uses, see "cef/README.txt". Look for CEF version in that file. Choose "Standard Distribution" binaries.
If you would like to build CEF from sources then see CEF Branches and building (external) wiki page.
The CEF binaries downloaded from Spotify after extracting have the "cef_binary_3.2987.1596.gc2b4638_windows32" directory. From now on we will refer to this directory as "cef_binary/" directory.
- Install CMake 2.8.12.1 or newer from http://www.cmake.org/ . During installation choose an option to add cmake to user's PATH.
- Download Ninja from https://github.com/ninja-build/ninja/releases . Put ninja.exe in your PATH or copy it to the build/ directory you will be creating in next step.
- In "cef_binary/" create a "build" directory and enter it
- Execute
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat"
(with quotes) - this sets environment variables for VS2015 for current session - all further commands need to be executed in current command window - Execute
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DUSE_SANDBOX=OFF ..
- Execute
ninja cefclient
- Go to the "cef_binary/build/tests/cefclient/Release/" directory and run cefclient.exe to see if it works fine
- Create "src/Release/" directory and copy files and subdirectories from the "cef_binary/Release/" and "cef_binary/Resources/" directories. Exclude ".lib" files. You may also copy cefclient.exe and cefclient.pdb from the "cef_binary/build/cefclient/" directory.
- Copy "cef_binary/build/libcef_dll_wrapper/libcef_dll_wrapper.lib" and "cef_binary/Release/libcef.lib" to the "src/lib/Release/" directory.
- To clean the cef_binary build directory just delete it. To only clean ninja build and keep cmake files intact type
ninja -t clean cefclient
. If you need DEBUG binaries re-run commands starting from step 6 withDCMAKE_BUILD_TYPE=Debug
and replace any "Release" directories mentioned with a "Debug" directory.
If you're building with version of CEF different from README.txt (eg. upgrading to a newer CEF) then delete the "src/cef/include/" directory and copy the "cef_binary/include/" directory (ignore the "capi" subdirectory). Also overwrite "src/cef/README.txt" file with "cef_binary/README.txt".
Go to http://windows.php.net/download/ and download PHP for "x86" and "Non Thread Safe". Extract it and put binaries in "src/php/" directory.
If you want to support Windows XP download PHP 5.4 binaries and additionally move all DLL extensions from php/ext/ directory to the root php/ directory. See Issue #34 for why it needs to be done so. You will also have to create/modify php.ini and set extension_dir option:
extension_dir=./
- Go to "src/" directory
- Open phpdesktop-chrome.sln file in Visual Studio
- Change configuration to Release
- Build phpdesktop-chrome project. This will generate src/Release/phpdesktop-chrome.exe executable.
- Run phpdesktop-chrome.exe executable