diff --git a/src/cloud/project/magento-app-php-application.md b/src/cloud/project/magento-app-php-application.md index 38456477a7d..bb5dd4c8fa3 100644 --- a/src/cloud/project/magento-app-php-application.md +++ b/src/cloud/project/magento-app-php-application.md @@ -16,7 +16,7 @@ type: php: ### PHP extensions -You can enable additional PHP extensions in the `runtime:extension` section. Also, the extensions specified become available in the Docker PHP containers. +You can enable or disable PHP extensions in the `runtime:extension` section. Also, the extensions specified become available in the Docker PHP containers. > .magento.app.yaml @@ -41,96 +41,18 @@ php -m For details about a specific PHP extension, see the [PHP Extension List](https://www.php.net/manual/en/extensions.alphabetical.php). -{{site.data.var.ece}} supports the following extensions: +The following table shows the supported PHP extensions when deploying {{site.data.var.ee}} on the Cloud platform. -- Default extensions: - - `bcmath` - - `bz2` - - `calendar` - - `exif` - - `gd` - - `gettext` - - `intl` - - `mysqli` - - `pcntl` - - `pdo_mysql` - - `soap` - - `sockets` - - `sysvmsg` - - `sysvsem` - - `sysvshm` - - `opcache` - - `zip` +{:.php-plugins-table} +| Default extensions | Installed extensions
that cannot be uninstalled | Extensions that can be installed
and uninstalled as needed| +|--------------------|---------------------|---------------------| +| `bcmath`
`bz2`
`calendar`
`exif`
`gd`
`gettext`
`intl`
`mysqli`
`pcntl`
`pdo_mysql`
`soap`
`sockets`
`sysvmsg`
`sysvsem`
`sysvshm`
`opcache`
`zip` |`ctype`
`curl`
`date`
`dom`
`fileinfo`
`filter`
`ftp`
`hash`
`iconv`
`json`
`mbstring`
`mysqlnd`
`openssl`
`pcre`
`pdo`
`pdo_sqlite`
`phar`
`posix`
`readline`
`session`
`sqlite3`
`tokenizer`
`xml`
`xmlreader`
`xmlwriter`
|`geoip`
`gmp`
`igbinary`
`imagick`
`imap`
`ioncube`
`ldap`
`mailparse`
`mcrypt`
`msgpack`
`mysqli`
`oauth`
`pdo_mysql`
`propro`
`pspell`
`raphf`
`recode`
`redis`
`shmop` `sockets`
`sodium`
`ssh2`
`tidy`
`xdebug`
`xmlrpc`
`xsl`
`yaml`| -- Extensions that are installed and cannot be uninstalled: - - `ctype` - - `curl` - - `date` - - `dom` - - `fileinfo` - - `filter` - - `ftp` - - `hash` - - `iconv` - - `json` - - `mbstring` - - `mysqlnd` - - `openssl` - - `pcre` - - `pdo` - - `pdo_sqlite` - - `phar` - - `posix` - - `readline` - - `session` - - `sqlite3` - - `tokenizer` - - `xml` - - `xmlreader` - - `xmlwriter` - -- Extensions that can be installed and uninstalled as needed: - - `bcmath` - - `bz2` - - `calendar` - - `exif` - - `gd` - - `geoip` - - `gettext` - - `gmp` - - `igbinary` - - `imagick` - - `imap` - - `intl` - - `ioncube` - - `ldap` - - `mailparse` - - `mcrypt` - - `msgpack` - - `mysqli` - - `oauth` - - `opcache` - - `pdo_mysql` - - `propro` - - `pspell` - - `raphf` - - `recode` - - `redis` - - `shmop` - - `soap` - - `sockets` - - `sodium` - - `ssh2` - - `sysvmsg` - - `sysvsem` - - `sysvshm` - - `tidy` - - `xdebug` - - `xmlrpc` - - `xsl` - - `yaml` - - `zip` - - `pcntl` +The PHP module requirements for {{ site.data.var.ee }} are tied to the Magento version. See [PHP requirements]({{ site.baseurl }}/guides/v2.4/install-gde/prereq/php-settings.html). {:.bs-callout-warning} PHP compiled with debug is not supported and the Probe may conflict with XDebug or XHProf. Disable those extensions when enabling the Probe. The Probe conflicts with some PHP extensions like Pinba or IonCube. + +### Custom PHP configuration + +You can customize the PHP settings for a Cloud environment by adding a `php.ini` file to your project. See [Customize PHP.INI]({{ site.baseurl }}/cloud/project/magento-app-php-ini.html). diff --git a/src/cloud/project/magento-app-php-ini.md b/src/cloud/project/magento-app-php-ini.md index c6bd2825454..bc4c3447056 100644 --- a/src/cloud/project/magento-app-php-ini.md +++ b/src/cloud/project/magento-app-php-ini.md @@ -6,22 +6,48 @@ functional_areas: - Setup - Application --- -You can also create and push a `php.ini` file that is appended to the configuration maintained by {{site.data.var.ee}}. -In your repository, the `php.ini` file should be added to the root of the application (the repository root). +You can customize the PHP settings for your environment using a `php.ini` file that is appended to the configuration maintained by {{site.data.var.ee}}. + +In your repository, add the `php.ini` file to the root of the application (the repository root). {:.bs-callout-info} Configuring PHP settings improperly can cause issues. We recommend only advanced administrators set these options. -For example, if you need to increase the PHP memory limit: +## Increase PHP memory limit -```bash -memory_limit = 756M +To increase the PHP memory limit, add the following setting to the `php.ini` file: + +```php +memory_limit = 1G +``` + +For debugging, increase the value to 2G. + +## Optimize realpath_cache configuration + +Set the following `realpath_cache` settings to improve Magento performance. + +```conf +; +; Increase realpath cache size +; +realpath_cache_size = 10M + +; +; Increase realpath cache ttl +; +realpath_cache_ttl = 7200 ``` -For a list of recommended PHP configuration settings, see [Required PHP settings]({{ site.baseurl }}/guides/v2.3/install-gde/prereq/php-settings.html). +These settings allow PHP processes to cache paths to files instead of looking them up each time a page loads. See [Performance Tuning](https://www.php.net/manual/en/ini.core.php) in the PHP documentation. + +{:.bs-callout-info} +For a list of recommended PHP configuration settings, see [Required PHP settings]({{ site.baseurl }}/guides/v2.4/install-gde/prereq/php-settings.html). + +## Check custom php.ini settings -After pushing your file, you can check that the custom PHP configuration has been added to your environment by [creating an SSH tunnel]({{ site.baseurl }}/cloud/env/environments-start.html#env-start-tunn) to your environment and entering: +After pushing the `php.ini` changes to your Cloud environment, you can check that the custom PHP configuration has been added to your environment by [creating an SSH tunnel]({{ site.baseurl }}/cloud/env/environments-start.html#env-start-tunn) to your environment and entering: ```bash cat /etc/php5/fpm/php.ini diff --git a/src/guides/v2.3/config-guide/multi-site/ms_nginx.md b/src/guides/v2.3/config-guide/multi-site/ms_nginx.md index 4e07709bc57..652f19db3e7 100644 --- a/src/guides/v2.3/config-guide/multi-site/ms_nginx.md +++ b/src/guides/v2.3/config-guide/multi-site/ms_nginx.md @@ -196,7 +196,7 @@ To modify the `nginx.conf.sample` file: fastcgi_buffers 1024 4k; fastcgi_param PHP_FLAG "session.auto_start=off \n suhosin.session.cryptua=off"; - fastcgi_param PHP_VALUE "memory_limit=756M \n max_execution_time=18000"; + fastcgi_param PHP_VALUE "memory_limit=1G \n max_execution_time=18000"; fastcgi_read_timeout 600s; fastcgi_connect_timeout 600s; @@ -224,7 +224,7 @@ location ~ (index|get|static|report|404|503|health_check)\.php$ { fastcgi_buffers 1024 4k; fastcgi_param PHP_FLAG "session.auto_start=off \n suhosin.session.cryptua=off"; - fastcgi_param PHP_VALUE "memory_limit=756M \n max_execution_time=18000"; + fastcgi_param PHP_VALUE "memory_limit=1G \n max_execution_time=18000"; fastcgi_read_timeout 600s; fastcgi_connect_timeout 600s; diff --git a/src/guides/v2.4/install-gde/prereq/php-settings.md b/src/guides/v2.4/install-gde/prereq/php-settings.md index 55b7ca95294..c622004423d 100644 --- a/src/guides/v2.4/install-gde/prereq/php-settings.md +++ b/src/guides/v2.4/install-gde/prereq/php-settings.md @@ -41,18 +41,25 @@ Magento requires a set of extensions to be installed: {% include install/php-extensions-template.md %} -In the command line, type: +{:.bs-callout-warning} +If you install Magento 2.3 by cloning the [magento/magento2](https://github.com/magento/magento2) GitHub repository, you must have the [ext-sockets](https://github.com/php-amqplib/php-amqplib/blob/master/CHANGELOG.md#281---2018-11-13) extension installed on your system. The `ext-sockets` extension is required for Magento 2.4. -```bash -php -m -``` +{:.procedure} +To verify installed extensions: -to see the list of installed modules. Verify that the listed extensions are installed. -If any modules are missing, they are added using the same workflow used for installing PHP. For example, if you use `yum` to install PHP, the PHP 7.4 modules can be added with: +1. List installed modules. -```bash - yum -y install php74u-pdo php74u-mysqlnd php74u-opcache php74u-xml php74u-gd php74u-devel php74u-mysql php74u-intl php74u-mbstring php74u-bcmath php74u-json php74u-iconv php74u-soap -``` + ```bash + php -m + ``` + +1. Verify that all required extensions are installed. + +1. Add any missing modules using the same workflow used for installing PHP. For example, if you use `yum` to install PHP, the PHP 7.4 modules can be added with: + + ```bash + yum -y install php74u-pdo php74u-mysqlnd php74u-opcache php74u-xml php74u-gd php74u-devel php74u-mysql php74u-intl php74u-mbstring php74u-bcmath php74u-json php74u-iconv php74u-soap + ``` {:.bs-callout-info} The `bcmath` extension is required for {{site.data.var.ee}} only. @@ -69,9 +76,18 @@ PHP Warning: date(): It is not safe to rely on the system's timezone settings. Our detailed recommendations are: - - Compiling code or deploying static assets, `756M` - - Installing and updating Magento components from Magento Marketplace, `2G` - - Testing, `~3-4G` + - Compiling code or deploying static assets, `1G` + - Debugging, `2G` + - Testing, `~3-4G` + +- Increase the values for the PHP `realpath_cache_size` and `realpath_cache_ttl` to recommended settings: + + ```conf + realpath_cache_size=10M + realpath_cache_ttl=7200 + ``` + + These settings allow PHP processes to cache paths to files instead of looking them up each time a page loads. See [Performance Tuning](https://www.php.net/manual/en/ini.core.php) in the PHP documentation. - Enable [`opcache.save_comments`](https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.save-comments){:target="_blank"}, which is required for Magento 2.1 and later. @@ -80,7 +96,7 @@ PHP Warning: date(): It is not safe to rely on the system's timezone settings. Magento 2.1 and later use PHP code comments for code generation. {:.bs-callout-info} -To avoid issues during installation and upgrade, we strongly recommend you apply the same PHP settings to both the PHP command-line configuration and the PHP web server plug-in's configuration. For more information, see the next section. +To avoid issues during installation and upgrade, we strongly recommend you apply the same PHP settings to both the PHP command-line configuration and the PHP web server plug-in configuration. For more information, see the next section. ## Step 1: Find PHP configuration files {#php-required-find} @@ -136,7 +152,8 @@ To set PHP options: ``` 1. Add the time zone setting you found in step 2. -1. Change the value of `memory_limit` to one of the values at the beginning of this section. + +1. Change the value of `memory_limit` to one of the values recommended at the beginning of this section. For example, @@ -144,7 +161,22 @@ To set PHP options: memory_limit=2G ``` +1. Add or update the `realpath_cache` configuration to match the following values: + + ```conf + ; + ; Increase realpath cache size + ; + realpath_cache_size = 10M + + ; + ; Increase realpath cache ttl + ; + realpath_cache_ttl = 7200 + ``` + 1. Save your changes and exit the text editor. + 1. Open the other `php.ini` (if they are different) and make the same changes in it. ## Step 3: Set OPcache options {#php-required-opcache} diff --git a/src/guides/v2.4/install-gde/prereq/prereq-overview.md b/src/guides/v2.4/install-gde/prereq/prereq-overview.md index 2502dd59a03..88604c15c85 100644 --- a/src/guides/v2.4/install-gde/prereq/prereq-overview.md +++ b/src/guides/v2.4/install-gde/prereq/prereq-overview.md @@ -65,7 +65,7 @@ To install or upgrade Apache, see [Apache]({{page.baseurl}}/install-gde/prereq/a {% include install/php-versions-2.4.md %} -See [PHP][] for info on PHP requirements. +See [PHP]({{page.baseurl}}/install-gde/prereq/php-settings.html) for info on PHP requirements. ### MySQL @@ -134,13 +134,3 @@ curl -XGET 'localhost:9200' Next step [Choose how to install the Magento software]({{page.baseurl}}/install-gde/bk-install-guide.html) - -{:.ref-header} -Related topics - -* [MySQL]({{page.baseurl}}/install-gde/prereq/mysql.html) -* [Apache]({{page.baseurl}}/install-gde/prereq/apache.html) -* [PHP]({{page.baseurl}}/install-gde/prereq/php-settings.html) -* [Elasticsearch]({{page.baseurl}}/install-gde/prereq/elasticsearch.html) -* [Installing optional software]({{page.baseurl}}/install-gde/prereq/optional.html) -* [How to get the Magento software]({{ page.baseurl }}/install-gde/bk-install-guide.html) diff --git a/src/guides/v2.4/performance-best-practices/software.md b/src/guides/v2.4/performance-best-practices/software.md index 70a0d2ac242..528314f52da 100644 --- a/src/guides/v2.4/performance-best-practices/software.md +++ b/src/guides/v2.4/performance-best-practices/software.md @@ -58,7 +58,18 @@ The presence of any profiling and debugging extensions can negatively impact the To guarantee successful execution of all Magento instances without dumping data or code to disk, set the memory limit as follows: -`memory_limit=768MB` +`memory_limit=1G` + +For debugging, increase this value to 2G. + +#### Realpath_cache configuration + +To improve Magento performance, add or update the following recommended `realpath_cache` settings in the `php.ini` file. This configuration allows PHP processes to cache paths to files instead of looking them up each time a page loads. See [Performance Tuning](https://www.php.net/manual/en/ini.core.php) in the PHP documentation. + +```text +realpath_cache_size=10M +realpath_cache_ttl=7200 +``` #### ByteCode