Skip to content

Commit 22c3728

Browse files
authored
Merge pull request #180 from sboldyreva/alt-php
Add additional configurations info for PHP for Linux
2 parents a4ab232 + 636b4eb commit 22c3728

File tree

1 file changed

+72
-1
lines changed

1 file changed

+72
-1
lines changed

docs/els-for-languages/php/README.md

Lines changed: 72 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,77 @@ Each version of PHP can be installed individually or all versions at once.
150150
{ title: 'deb', content: 'apt-get install alt-php' }
151151
]" />
152152

153+
### Additional configurations (optional)
154+
155+
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.
156+
157+
#### Enabling a module through `default.ini`
158+
159+
To enable or disable extensions in your installed PHP version:
160+
161+
1. Open the `default.ini` file, usually located in the PHP configuration directory, in an editor of your choice:
162+
163+
<CodeWithCopy>
164+
165+
```
166+
/opt/alt/phpXY/etc/php.d/default.ini
167+
```
168+
169+
</CodeWithCopy>
170+
171+
2. Edit the list of extensions:
172+
* To enable an extension, remove the semicolon `;` at the beginning of the line.
173+
* To disable an extension, add a semicolon `;` at the beginning of the line.
174+
* If the extension line is missing, add it in this format: `extension=extension_name.so` (replace `extension_name.so` with the actual extension name).
175+
176+
3. Save the changes in the `default.ini` file.
177+
178+
#### Enabling a module through the configuration files
179+
180+
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.
181+
182+
1. Locate the extension’s `.ini` file (e.g., `memcached.ini`) in the directory:
183+
184+
<CodeWithCopy>
185+
186+
```
187+
/opt/alt/phpXY/etc/php.d.all/
188+
```
189+
190+
</CodeWithCopy>
191+
192+
2. To enable the extension, copy the located `.ini` file to:
193+
194+
<CodeWithCopy>
195+
196+
```
197+
/opt/alt/phpXY/etc/php.d/
198+
```
199+
200+
</CodeWithCopy>
201+
202+
:::warning
203+
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.
204+
:::
205+
206+
#### Increase Upload/Memory Limits
207+
208+
If you need to increase memory and upload size limits:
209+
210+
1. Open the `default.ini` file in an editor of your choice.
211+
2. Set the limits as needed, e.g:
212+
213+
<CodeWithCopy>
214+
215+
```text
216+
upload_max_filesize=40M
217+
post_max_size=40M
218+
memory_limit=256M
219+
```
220+
221+
</CodeWithCopy>
222+
223+
153224
## Installation Instructions for Windows
154225
155226
### Get user credentials
@@ -664,4 +735,4 @@ zlib
664735

665736
### Conclusion
666737

667-
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.
738+
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.

0 commit comments

Comments
 (0)