PHP

Installation of the PHP binding

Introduction

Please read the introductory page before proceeding.

If you have any suggestion on how to ameliorate the installation process, you are welcome to create a discussion or to participate to a related one in this forum.

Installation of the toolkit

To install the PHP binding of the Atlas toolkit, in addition of the requirement indicated in above mentioned introductory page, you naturally have PHP to be installed. For Windows, it's the regular package, for other OSes, you must install the development one.

The Atlas toolkit was tested only against PHP version 7.1, and the Windows pre-compiled version is only available for the VC14 x64 Non Thread Safe version. There is no guarantee that the Atlas toolkit works with another version of PHP.

We plan to support more versions of PHP, but there are other issues concerning the PHP binding to solve before. See here for more information.

Once all the needed software be installed, you have to launch npm install atlastk-php. This will install all the needed files including binaries, except the PHP wrapper binary. This one has to be handled manually, as it is a C++ written PHP extension, and hence has to be built following a special procedure, which is hard to be handled by the NPM packaging system.

Windows

Retrieve the binary (zndq.dll) in the releases section of the GitHub repository of zndq (usually the latest one), and put it in the root of the application.

Other OSes

Go to node_modules/zndq, and launch:

  • phpize,
  • ./configure,
  • make.

After that, put the the zndq.so file that you will find in the modules directory in the root directory of your application.

Installation of the examples

The examples naturally needs the Atlas toolkit, which will be installed automatically if needed, so this examples have the same software requirements as indicated above. However, you still need to handle the PHP wrapper binary as indicated above, but after having launched the npm install command.

TodoMVC

This is the PHP version of the TodoMVC application.

Retrieve the following repository: http://github.com/epeios-q37/todomvc-php/, then, from the inner of the repository, launch npm install.

  • Under Windows:
    • to launch the desktop version of the application, launch php -dextension=./zndq.dll main.php.
    • for the web version, launch php -dextension=./zndq.dll main.php web, and go to http://localhost:8080.
  • Under other OSes:
    • to launch the desktop version of the application, launch php -dextension=./zndq.so main.php.
    • for the web version, launch php -dextension=./zndq.so main.php web, and go to http://localhost:8080.

Other

This is the application you can see at http://atlastk.org:8080.

Retrieve this the following repository: http://github.com/epeios-q37/atlas-php-demo/, then, from the inner of the repository, launch npm install.

  • Under Windows:
    • to launch the desktop version of the application, launch php -dextension=./zndq.dll notes/main.php.
    • for the web version, launch php -dextension=./zndq.dll main.php web, and go to http://localhost:8080.
  • Under other OSes:
    • to launch the desktop version of the application, launch php -dextension=./zndq.so main.php.
    • for the web version, launch php -dextension=./zndq.so notes/main.php web, and go to http://localhost:8080.

There is another example, a very basic one, which you can launch with php -dextension=./zndq.(dll|so) Blank/main.php [web]. You can use a copy of this example as starting point for your own application.