Skip to content

Installing PHP-GLFW on Linux

We currently do not provide an installer script for Linux like we do for MacOS. However, the "manual" installation process should be straightforward for Linux users.

Manual installation

Ensure that you have installed the required php-dev, git, and cmake packages.

sudo apt install -y cmake git 

Clone the repository:

git clone https://github.com/mario-deluna/php-glfw
cd php-glfw

Configure and build the extension:

sudo phpize && ./configure --enable-glfw
sudo make install

Ensure that you add glfw.so to your php.ini file.

You can determine the path to your php.ini file using the following command:

php -i | grep php.ini

Edit that file using your favorite editor:

sudo vi /usr/local/etc/php/8.1/php.ini

Then, add the following line at the end of the file:

extension="glfw.so"