Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update EmptyExtension.tar.gz #11

Open
jpuck opened this issue Aug 1, 2017 · 1 comment
Open

update EmptyExtension.tar.gz #11

jpuck opened this issue Aug 1, 2017 · 1 comment

Comments

@jpuck
Copy link
Contributor

jpuck commented Aug 1, 2017

The Makefile is different in the downloadable demo archive from the example on this page: https://www.php-cpp.com/documentation/your-first-extension

The demo archive seems to contain an older version only for php 5.

Here's the actual diff:

 #
 #   Php.ini directories
 #
@@ -28,9 +27,22 @@ NAME             =   yourextension
 #   PHP installations use a conf.d directory that holds a set of config files,
 #   one for each extension. Use this variable to specify this directory.
 #
+#   In Ubuntu 14.04 Apache 2.4 is used, which uses the mods-available directory
+#   instead of a conf.d directory. In 16.04 the directory changed yet again.
+#   This has to be checked.
+#
 
-INI_DIR                =   /etc/php5/conf.d
+UBUNTU_MAJOR  := $(shell /usr/bin/lsb_release -r -s | cut -f1 -d.)
+OVER_SIXTEEN  := $(shell echo "${UBUNTU_MAJOR} >= 16" | bc)
+OVER_FOURTEEN := $(shell echo "${UBUNTU_MAJOR} >= 14" | bc)
 
+ifeq (${OVER_SIXTEEN}, 1)
+    INI_DIR     =   /etc/php/7.0/mods-available/
+else ifeq (${OVER_FOURTEEN}, 1)
+    INI_DIR     =   /etc/php5/mods-available/
+else
+    INI_DIR     =   /etc/php5/conf.d/
+endif
@Nek-
Copy link

Nek- commented Oct 14, 2020

This change still needs to be done. 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants