Getting Started

This is a starter template for creating a beautiful, customizable documentation site for your project with minimal effort. You’ll only have to change a few settings and you’re ready to go.

Windows Install

I am working on an installing, for the time being you can following the instructions below.

To get up and running you need the following:

Go ahead extract the PHP runtime php-7.4.4-Win32-vc15-x64.zip to a place you can access. Then extract php_raylib-7.4-thread-safe-x64.zip into the PHP folder ext/. So you should have the following folder setup.

|-- README.md
|-- deplister.exe
|-- dev
|-- ext
|---ext/php_raylib.dll
|---ext/php_raylib.dll
|---ext/php_raylib.dll
|---ext/php_raylib.dll
|-- .....
|-- php.exe
|-- php.ini-development
|-- php.ini-production
|-- .....

Now in the php folder, you need to copy and rename php.ini-development to php.ini and then edit the following lines.

php.ini - Lines: 753-757

; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
;extension_dir = "./"
; On windows:
;extension_dir = "ext"

Uncomment line 757 extension_dir for Windows and it should read:

; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
;extension_dir = "./"
; On windows:
extension_dir = "ext"

Next you want to make one more edit, at the bottom of the php.ini file, the last line add the following:

extension=raylib

Linux Install

For the time being I only have information for Ubuntu. I want to make a SNAP version to make this easier but for now, you need to compile everything.

Add the ondrej/php repo:

sudo apt-get update
sudo apt -y install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update

Now install PHP:

sudo apt -y install php7.4 php7.4-{bcmath,bz2,intl,gd,mbstring,mysql,zip,xml,curl,dev}

Next you need to setup the development tools for RayLib itself:

sudo apt install build-essential git cmake libasound2-dev mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev

Now clone, build and install RayLib

git clone https://github.com/raysan5/raylib.git raylib
cd raylib/src/
make PLATFORM=PLATFORM_DESKTOP RAYLIB_LIBTYPE=SHARED
sudo make install RAYLIB_LIBTYPE=SHARED

Now clone, and and install the RayLib-PHP extension

git clone https://github.com/joseph-montanez/raylib-php.git
phpize
./configure
make
sudo make install