Skip to content

Update enabling a module info #261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 52 additions & 43 deletions docs/cloudlinuxos/alt-ea_packages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,7 @@ When you deploy an updated version of PHP, using your system’s regular update
the new version will be installed under `/opt/alt/php[version]/`. This means that all modules, configurations and additional files pertaining to this version will be contained inside that path.
Different versions of PHP will each have their own path and can coexist without issues on the same system. Below you will find the location of all the relevant files, should you want to make any changes.

#### The bin files:
### The bin files:

<div class="notranslate">

Expand All @@ -1138,7 +1138,7 @@ dbunit lsphp peardev phar php
```
</div>

#### Modules and pecl extensions:
### Modules and pecl extensions:

<div class="notranslate">

Expand Down Expand Up @@ -1180,7 +1180,7 @@ igbinary.so oauth.so stats.so
```
</div>

#### Running code on a specific version through the CLI:
### Running code on a specific version through the CLI:

<div class="notranslate">

Expand All @@ -1190,7 +1190,7 @@ Hello, World!
```
</div>

#### Location of ini config files:
### Location of ini config files:

<div class="notranslate">

Expand Down Expand Up @@ -1232,7 +1232,7 @@ lzf.ini raphf.ini
```
</div>

#### Location of default.ini:
### Location of default.ini:

<div class="notranslate">

Expand All @@ -1241,7 +1241,7 @@ ls /opt/alt/phpXY/etc/php.d/default.ini
```
</div>

#### Listing enabled modules on a specific version:
### Listing enabled modules on a specific version:

<div class="notranslate">

Expand Down Expand Up @@ -1281,7 +1281,7 @@ zlib
```
</div>

#### Enabling a module through the CLI:
### Enabling a module through the CLI:

<div class="notranslate">

Expand Down Expand Up @@ -1326,66 +1326,75 @@ As you can see, each version is entirely self-contained,
and changing configurations in one will not impact the others,
a desired feature in hosting environments.

#### Enabling a module through the configuration files:
### Additional configurations (optional)

**1. Direct inclusion in the specific extension's ini file:**
The **default.ini** file is important for configuring alt-php. It sets default PHP settings and can be used to enable default extensions. We do not modify this file on our side. You need to update **default.ini** yourself to adjust PHP settings based on your Endless Lifecycle Support (ELS) usage and specific requirements.

- If each extension has its own ini file (e.g., memcached.ini),
open that file. Location of ini config files:
#### Enabling a module through `default.ini`

<div class="notranslate">
To enable or disable extensions in your installed PHP version:

```
/opt/alt/phpXY/etc/php.d.all/
```
</div>
1. Open the `default.ini` file, usually located in the PHP configuration directory, in an editor of your choice:

- Inside the ini file, find lines starting with `;` before the extension name
(e.g., `;extension=memcached.so`). The `;` sign at the beginning of the line means that this extension is currently inactive.
<div class="notranslate">

- Remove the `;` before the line with the extension name to activate it.
```
/opt/alt/phpXY/etc/php.d/default.ini
```

- Save the changes in the ini file.
</div>

If there is no such line:
2. Edit the list of extensions:
* To enable an extension, remove the semicolon `;` at the beginning of the line.
* To disable an extension, add a semicolon `;` at the beginning of the line.
* If the extension line is missing, add it in this format: `extension=extension_name.so` (replace `extension_name.so` with the actual extension name).

- Inside the ini file, add line `extension=memcached.so`
3. Save the changes in the `default.ini` file.

- Save the changes in the ini file.
#### Enabling a module through the configuration files

**2. Enabling through default.ini:**
PHP extensions can also be enabled or disabled through their `.ini` configuration files. This method allows you to control which extensions are active for a specific PHP version or setup. If you're unsure which file to modify to enable a specific extension, start by checking the extension's own `.ini` file.

- Open the default.ini file, usually located in the PHP configuration directory:
1. Locate the extension’s `.ini` file (e.g., `memcached.ini`) in the directory:

<div class="notranslate">
<div class="notranslate">

```
/opt/alt/phpXY/etc/php.d/default.ini
```
</div>
```
/opt/alt/phpXY/etc/php.d.all/
```

</div>

2. To enable the extension, copy the located `.ini` file to:

- Find lines starting with `;` before the extension name. The `;` sign at the beginning of the line means that this extension is currently inactive.
<div class="notranslate">

- Remove the `;` before the line with the extension name to activate it.
```
/opt/alt/phpXY/etc/php.d/
```

If there is no such line:
</div>

- Add line `extension=extension name.so`
(where `extension name.so` - name of extension you need).
:::warning
If the same extension is present in multiple `.ini` configuration files within the `/opt/alt/phpXY/etc/php.d/` directory, you may see warnings in PHP logs and possibly on your site.
:::

- Save the changes in the default.ini file.
#### Increase Upload/Memory Limits

***Note:***
If you need to increase memory and upload size limits:

*- Typically, extensions with their own ini files are enabled or disabled directly in their respective ini files,
allowing for more explicit specification of which extensions should be enabled for a specific PHP configuration.*
1. Open the `default.ini` file in an editor of your choice.
2. Set the limits as needed, e.g:

*- On the other hand, extensions that should be enabled by default on all systems may be listed in default.ini.
This file is used to set default settings for PHP and can be used to enable default extensions.*
<div class="notranslate">

*- If you're unsure which file to modify to enable a specific extension, it's recommended to first try enabling it in the extension's own ini file.
If you encounter issues or need to enable an extension on all systems by default, you can try adding it to default.ini.*
```text
upload_max_filesize=40M
post_max_size=40M
memory_limit=256M
```

</div>


## alt-python
Expand Down