Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
devcontainer-features
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
eazydevelop-devcontainer-temp
devcontainer-features
Commits
ef192bf4
Unverified
Commit
ef192bf4
authored
Jan 04, 2023
by
Samruddhi Khandale
Committed by
GitHub
Jan 04, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PHP: Fix build failures for 'ubuntu:bionic' (#378)
* PHP: Fix build failures for 'ubuntu:bionic' * update VERSION
parent
8f7eec80
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
12 deletions
+20
-12
devcontainer-feature.json
src/php/devcontainer-feature.json
+1
-1
install.sh
src/php/install.sh
+19
-11
No files found.
src/php/devcontainer-feature.json
View file @
ef192bf4
{
{
"id"
:
"php"
,
"id"
:
"php"
,
"version"
:
"1.0.1
0
"
,
"version"
:
"1.0.1
1
"
,
"name"
:
"PHP"
,
"name"
:
"PHP"
,
"documentationURL"
:
"https://github.com/devcontainers/features/tree/main/src/php"
,
"documentationURL"
:
"https://github.com/devcontainers/features/tree/main/src/php"
,
"options"
:
{
"options"
:
{
...
...
src/php/install.sh
View file @
ef192bf4
...
@@ -11,7 +11,7 @@ set -eux
...
@@ -11,7 +11,7 @@ set -eux
# Clean up
# Clean up
rm
-rf
/var/lib/apt/lists/
*
rm
-rf
/var/lib/apt/lists/
*
VERSION
=
"
${
VERSION
:-
"latest"
}
"
PHP_
VERSION
=
"
${
VERSION
:-
"latest"
}
"
INSTALL_COMPOSER
=
"
${
INSTALLCOMPOSER
:-
"true"
}
"
INSTALL_COMPOSER
=
"
${
INSTALLCOMPOSER
:-
"true"
}
"
OVERRIDE_DEFAULT_VERSION
=
"
${
OVERRIDEDEFAULTVERSION
:-
"true"
}
"
OVERRIDE_DEFAULT_VERSION
=
"
${
OVERRIDEDEFAULTVERSION
:-
"true"
}
"
...
@@ -20,7 +20,7 @@ USERNAME="${USERNAME:-"${_REMOTE_USER:-"automatic"}"}"
...
@@ -20,7 +20,7 @@ USERNAME="${USERNAME:-"${_REMOTE_USER:-"automatic"}"}"
UPDATE_RC
=
"
${
UPDATE_RC
:-
"true"
}
"
UPDATE_RC
=
"
${
UPDATE_RC
:-
"true"
}
"
# Comma-separated list of php versions to be installed
# Comma-separated list of php versions to be installed
# alongside VERSION, but not set as default.
# alongside
PHP_
VERSION, but not set as default.
ADDITIONAL_VERSIONS
=
"
${
ADDITIONALVERSIONS
:-
""
}
"
ADDITIONAL_VERSIONS
=
"
${
ADDITIONALVERSIONS
:-
""
}
"
export
DEBIAN_FRONTEND
=
noninteractive
export
DEBIAN_FRONTEND
=
noninteractive
...
@@ -92,7 +92,7 @@ find_version_from_git_tags() {
...
@@ -92,7 +92,7 @@ find_version_from_git_tags() {
local
last_part
=
"
${
escaped_separator
}
[0-9]+"
local
last_part
=
"
${
escaped_separator
}
[0-9]+"
local
regex
=
"
\\
K[0-9]+
${
escaped_separator
}
[0-9]+
${
last_part
}
$"
local
regex
=
"
\\
K[0-9]+
${
escaped_separator
}
[0-9]+
${
last_part
}
$"
local
version_list
=
"
$(
git ls-remote
--tags
${
repository
}
|
grep
-oP
"
${
regex
}
"
|
tr
-d
' '
|
tr
"
${
separator
}
"
"."
|
sort
-rV
)
"
local
version_list
=
"
$(
git ls-remote
--tags
${
repository
}
|
grep
-oP
"
${
regex
}
"
|
tr
-d
' '
|
tr
"
${
separator
}
"
"."
|
sort
-rV
)
"
VERSION
=
"
$(
echo
"
${
version_list
}
"
|
head
-n
1
)
"
PHP_
VERSION
=
"
$(
echo
"
${
version_list
}
"
|
head
-n
1
)
"
}
}
# Install PHP Composer
# Install PHP Composer
...
@@ -113,7 +113,15 @@ addcomposer() {
...
@@ -113,7 +113,15 @@ addcomposer() {
RUNTIME_DEPS
=
"wget ca-certificates git build-essential xz-utils"
RUNTIME_DEPS
=
"wget ca-certificates git build-essential xz-utils"
# PHP dependencies
# PHP dependencies
PHP_DEPS
=
"libssl-dev libcurl4-openssl-dev libedit-dev libsqlite3-dev libxml2-dev zlib1g-dev libsodium-dev libargon2-dev libonig-dev"
PHP_DEPS
=
"libssl-dev libcurl4-openssl-dev libedit-dev libsqlite3-dev libxml2-dev zlib1g-dev libsodium-dev libonig-dev"
.
/etc/os-release
if
[
"
${
VERSION_CODENAME
}
"
=
"bionic"
]
;
then
PHP_DEPS
=
"
${
PHP_DEPS
}
libargon2-0-dev"
else
PHP_DEPS
=
"
${
PHP_DEPS
}
libargon2-dev"
fi
# Dependencies required for running "phpize"
# Dependencies required for running "phpize"
PHPIZE_DEPS
=
"autoconf dpkg-dev file g++ gcc libc-dev make pkg-config re2c"
PHPIZE_DEPS
=
"autoconf dpkg-dev file g++ gcc libc-dev make pkg-config re2c"
...
@@ -122,16 +130,16 @@ PHPIZE_DEPS="autoconf dpkg-dev file g++ gcc libc-dev make pkg-config re2c"
...
@@ -122,16 +130,16 @@ PHPIZE_DEPS="autoconf dpkg-dev file g++ gcc libc-dev make pkg-config re2c"
check_packages
$RUNTIME_DEPS
$PHP_DEPS
$PHPIZE_DEPS
check_packages
$RUNTIME_DEPS
$PHP_DEPS
$PHPIZE_DEPS
install_php
()
{
install_php
()
{
VERSION
=
"
$1
"
PHP_
VERSION
=
"
$1
"
# Fetch latest version of PHP if needed
# Fetch latest version of PHP if needed
if
[
"
${
VERSION
}
"
=
"latest"
]
||
[
"
${
VERSION
}
"
=
"lts"
]
;
then
if
[
"
${
PHP_VERSION
}
"
=
"latest"
]
||
[
"
${
PHP_
VERSION
}
"
=
"lts"
]
;
then
find_version_from_git_tags
find_version_from_git_tags
fi
fi
PHP_INSTALL_DIR
=
"
${
PHP_DIR
}
/
${
VERSION
}
"
PHP_INSTALL_DIR
=
"
${
PHP_DIR
}
/
${
PHP_
VERSION
}
"
if
[
-d
"
${
PHP_INSTALL_DIR
}
"
]
;
then
if
[
-d
"
${
PHP_INSTALL_DIR
}
"
]
;
then
echo
"(!) PHP version
${
VERSION
}
already exists."
echo
"(!) PHP version
${
PHP_
VERSION
}
already exists."
exit
1
exit
1
fi
fi
...
@@ -140,7 +148,7 @@ install_php() {
...
@@ -140,7 +148,7 @@ install_php() {
fi
fi
usermod
-a
-G
php
"
${
USERNAME
}
"
usermod
-a
-G
php
"
${
USERNAME
}
"
PHP_URL
=
"https://www.php.net/distributions/php-
${
VERSION
}
.tar.gz"
PHP_URL
=
"https://www.php.net/distributions/php-
${
PHP_
VERSION
}
.tar.gz"
PHP_INI_DIR
=
"
${
PHP_INSTALL_DIR
}
/ini"
PHP_INI_DIR
=
"
${
PHP_INSTALL_DIR
}
/ini"
CONF_DIR
=
"
${
PHP_INI_DIR
}
/conf.d"
CONF_DIR
=
"
${
PHP_INI_DIR
}
/conf.d"
...
@@ -160,7 +168,7 @@ install_php() {
...
@@ -160,7 +168,7 @@ install_php() {
# PHP 7.4+, the pecl/pear installers are officially deprecated and are removed in PHP 8+
# PHP 7.4+, the pecl/pear installers are officially deprecated and are removed in PHP 8+
# Thus, requiring an explicit "--with-pear"
# Thus, requiring an explicit "--with-pear"
IFS
=
"."
IFS
=
"."
read
-a
versions
<<<
"
${
VERSION
}
"
read
-a
versions
<<<
"
${
PHP_
VERSION
}
"
PHP_MAJOR_VERSION
=
${
versions
[0]
}
PHP_MAJOR_VERSION
=
${
versions
[0]
}
PHP_MINOR_VERSION
=
${
versions
[1]
}
PHP_MINOR_VERSION
=
${
versions
[1]
}
...
@@ -210,7 +218,7 @@ install_php() {
...
@@ -210,7 +218,7 @@ install_php() {
updaterc
"if [[
\"\$
{PATH}
\"
!= *
\"
${
CURRENT_DIR
}
\"
* ]]; then export PATH=
\"
${
CURRENT_DIR
}
/bin:
\$
{PATH}
\"
; fi"
updaterc
"if [[
\"\$
{PATH}
\"
!= *
\"
${
CURRENT_DIR
}
\"
* ]]; then export PATH=
\"
${
CURRENT_DIR
}
/bin:
\$
{PATH}
\"
; fi"
}
}
install_php
"
${
VERSION
}
"
install_php
"
${
PHP_
VERSION
}
"
# Additional php versions to be installed but not be set as default.
# Additional php versions to be installed but not be set as default.
if
[
!
-z
"
${
ADDITIONAL_VERSIONS
}
"
]
;
then
if
[
!
-z
"
${
ADDITIONAL_VERSIONS
}
"
]
;
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment