Skip to content

Commit a354273

Browse files
authored
Merge pull request #261 from sboldyreva/alt-php
Update enabling a module info
2 parents 59ed689 + 40cae5e commit a354273

File tree

1 file changed

+52
-43
lines changed

1 file changed

+52
-43
lines changed

docs/cloudlinuxos/alt-ea_packages/README.md

Lines changed: 52 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,7 @@ When you deploy an updated version of PHP, using your system’s regular update
11271127
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.
11281128
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.
11291129

1130-
#### The bin files:
1130+
### The bin files:
11311131

11321132
<div class="notranslate">
11331133

@@ -1138,7 +1138,7 @@ dbunit lsphp peardev phar php
11381138
```
11391139
</div>
11401140

1141-
#### Modules and pecl extensions:
1141+
### Modules and pecl extensions:
11421142

11431143
<div class="notranslate">
11441144

@@ -1180,7 +1180,7 @@ igbinary.so oauth.so stats.so
11801180
```
11811181
</div>
11821182

1183-
#### Running code on a specific version through the CLI:
1183+
### Running code on a specific version through the CLI:
11841184

11851185
<div class="notranslate">
11861186

@@ -1190,7 +1190,7 @@ Hello, World!
11901190
```
11911191
</div>
11921192

1193-
#### Location of ini config files:
1193+
### Location of ini config files:
11941194

11951195
<div class="notranslate">
11961196

@@ -1232,7 +1232,7 @@ lzf.ini raphf.ini
12321232
```
12331233
</div>
12341234

1235-
#### Location of default.ini:
1235+
### Location of default.ini:
12361236

12371237
<div class="notranslate">
12381238

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

1244-
#### Listing enabled modules on a specific version:
1244+
### Listing enabled modules on a specific version:
12451245

12461246
<div class="notranslate">
12471247

@@ -1281,7 +1281,7 @@ zlib
12811281
```
12821282
</div>
12831283

1284-
#### Enabling a module through the CLI:
1284+
### Enabling a module through the CLI:
12851285

12861286
<div class="notranslate">
12871287

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

1329-
#### Enabling a module through the configuration files:
1329+
### Additional configurations (optional)
13301330

1331-
**1. Direct inclusion in the specific extension's ini file:**
1331+
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.
13321332

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

1336-
<div class="notranslate">
1335+
To enable or disable extensions in your installed PHP version:
13371336

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

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

1346-
- Remove the `;` before the line with the extension name to activate it.
1341+
```
1342+
/opt/alt/phpXY/etc/php.d/default.ini
1343+
```
13471344

1348-
- Save the changes in the ini file.
1345+
</div>
13491346

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

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

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

1356-
**2. Enabling through default.ini:**
1356+
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.
13571357

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

1360-
<div class="notranslate">
1360+
<div class="notranslate">
13611361

1362-
```
1363-
/opt/alt/phpXY/etc/php.d/default.ini
1364-
```
1365-
</div>
1362+
```
1363+
/opt/alt/phpXY/etc/php.d.all/
1364+
```
1365+
1366+
</div>
1367+
1368+
2. To enable the extension, copy the located `.ini` file to:
13661369

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

1369-
- Remove the `;` before the line with the extension name to activate it.
1372+
```
1373+
/opt/alt/phpXY/etc/php.d/
1374+
```
13701375

1371-
If there is no such line:
1376+
</div>
13721377

1373-
- Add line `extension=extension name.so`
1374-
(where `extension name.so` - name of extension you need).
1378+
:::warning
1379+
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.
1380+
:::
13751381

1376-
- Save the changes in the default.ini file.
1382+
#### Increase Upload/Memory Limits
13771383

1378-
***Note:***
1384+
If you need to increase memory and upload size limits:
13791385

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

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

1386-
*- 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.
1387-
If you encounter issues or need to enable an extension on all systems by default, you can try adding it to default.ini.*
1391+
```text
1392+
upload_max_filesize=40M
1393+
post_max_size=40M
1394+
memory_limit=256M
1395+
```
13881396

1397+
</div>
13891398

13901399

13911400
## alt-python

0 commit comments

Comments
 (0)