Skip to content

update EmptyExtension.tar.gz #11

@jpuck

Description

@jpuck

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions