All Products
Search
Document Center

Serverless App Engine:Configure a configuration file for a PHP application

Last Updated:Sep 03, 2024

SAE allows you to configure a custom configuration file for your PHP application. After you configure the settings, SAE starts the application by using your custom configuration file. This topic describes how to configure a configuration file for your PHP application and check whether the configuration file is loaded.

Procedure

Configure a configuration file when you create a PHP application

  1. Log on to the SAE console.

  2. In the left-side navigation pane, click Applications. In the top navigation bar, select a region. Then, click Create Application.

  3. In the Basic Information step, configure the parameters and click Next: Application Deployment Configurations.

  4. In the Deployment Configurations step, configure the Technology Stack Programming Language and Application Deployment Method parameters and the corresponding settings.

  5. In the Modify php.ini Configuration File section, specify content for the configuration file. Then, specify a mount path in the php.ini Mount Path field.
    Configure a configuration file for a PHP application
  6. Click Next: Confirm Specifications.

  7. In the Specification Confirmation step, view the details of the application and the fee for the selected specifications. Then, click Confirm.

    The Creation Completed step appears. You can click Application Details to go to the Basic Information page of the application.

Configure a configuration file when you deploy a PHP application

Warning

After you redeploy an application, the application is restarted. To prevent unpredictable errors such as business interruptions, we recommend that you deploy applications during off-peak hours.

The procedure that can be performed to update an application varies based on the number of instances in the application. This section provides an example on how to configure the required features for an application in which the number of instances is greater than or equal to 1. For information about how to update an application in which the number of instances is 0, see Update an application.

  1. Log on to the SAE console.

  2. In the left-side navigation pane, click Applications. In the top navigation bar, select a region. Then, click the name of an application.

  3. In the upper-right corner of the Basic Information page, click Deploy Application.

  4. In the Modify php.ini Configuration File section, specify content for the configuration file. Then, specify a mount path in the php.ini Mount Path field.
    Configure a configuration file for a PHP application
  5. After you configure the settings, click Confirm.

Verify the result

To check whether the configuration file is loaded, perform the following steps:

  1. Log on to the SAE console.

  2. In the left-side navigation pane, click Applications. In the top navigation bar, select a region. Then, click the name of an application.

  3. On the Basic Information page of the application, click Instance Deployment Information. On the Instance Deployment Information tab, click Webshell in the Actions column of an instance. Then, run the following commands in the editor to check whether the configuration file is loaded:
    php -i | grep ini

    If the following output is returned, the configuration file is loaded:

    Loaded Configuration File => /usr/local/etc/php/php.ini