From 70fd71ab48afbbc3ea733c6309d27c0dd1dcf931 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Sat, 18 Jul 2020 05:53:26 +0530 Subject: [PATCH] Set memory_limit=-1 on Windows and macOS --- .github/workflows/main-workflow.yml | 1 + src/scripts/darwin.sh | 4 ++-- src/scripts/win32.ps1 | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main-workflow.yml b/.github/workflows/main-workflow.yml index 5f0abb20..b303dd2a 100644 --- a/.github/workflows/main-workflow.yml +++ b/.github/workflows/main-workflow.yml @@ -50,6 +50,7 @@ jobs: php -r "if(phpversion()>=7.1 && ! extension_loaded('pcov')) {throw new Exception('PCOV not found');}" - name: Testing ini values run: | + php -r "if(ini_get('memory_limit')!='-1') {throw new Exception('memory_limit not disabled');}" php -r "if(ini_get('post_max_size')!='256M') {throw new Exception('post_max_size not added');}" php -r "if(ini_get('short_open_tag')!=1) {throw new Exception('short_open_tag not added');}" php -r "if(ini_get('date.timezone')!='Asia/Kolkata') {throw new Exception('date.timezone not added');}" \ No newline at end of file diff --git a/src/scripts/darwin.sh b/src/scripts/darwin.sh index 898c259b..fd7daa0d 100644 --- a/src/scripts/darwin.sh +++ b/src/scripts/darwin.sh @@ -206,8 +206,8 @@ else fi ini_file=$(php -d "date.timezone=UTC" --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g") sudo chmod 777 "$ini_file" "$tool_path_dir" -echo "date.timezone=UTC" >>"$ini_file" -ext_dir=$(php -i | grep -Ei "extension_dir => /(usr|opt)" | sed -e "s|.*=> s*||") +echo -e "date.timezone=UTC\nmemory_limit=-1" >>"$ini_file" +ext_dir=$(php -i | grep -Ei "extension_dir => /" | sed -e "s|.*=> s*||") scan_dir=$(php --ini | grep additional | sed -e "s|.*: s*||") sudo mkdir -p "$ext_dir" semver=$(php -v | head -n 1 | cut -f 2 -d ' ') diff --git a/src/scripts/win32.ps1 b/src/scripts/win32.ps1 index 4b0aecf1..ba7803a4 100644 --- a/src/scripts/win32.ps1 +++ b/src/scripts/win32.ps1 @@ -270,6 +270,7 @@ if ($null -eq $installed -or -not("$($installed.Version).".StartsWith(($version $installed = Get-Php -Path $php_dir Set-PhpIniKey -Key 'date.timezone' -Value 'UTC' -Path $php_dir +Set-PhpIniKey -Key 'memory_limit' -Value '-1' -Path $php_dir Enable-PhpExtension -Extension openssl, curl, opcache, mbstring -Path $php_dir Update-PhpCAInfo -Path $php_dir -Source CurrentUser if ($version -eq 'master') {