Skip to content

Commit 59670d9

Browse files
committed
Add additional configurations info for PHP for Linux
1 parent a4ab232 commit 59670d9

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

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

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,82 @@ 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+
PHP extensions can be enabled or disabled in different configuration files.
158+
* If you need to enable or disable an extension by *default* across all systems, list it by updating the `default.ini`.
159+
* If you want to enable or disable an extension only for a *specific* PHP version or setup, start by editing that extension's individual `.ini` file.
160+
161+
#### Enabling a module through `default.ini`
162+
163+
To enable or disable extensions in your installed PHP version:
164+
165+
1. Open the `default.ini` file, usually located in the PHP configuration directory, in an editor of your choice:
166+
167+
<CodeWithCopy>
168+
169+
```
170+
/opt/alt/phpXY/etc/php.d/default.ini
171+
```
172+
173+
</CodeWithCopy>
174+
175+
2. Edit the list of extensions:
176+
* To enable an extension, remove the semicolon `;` at the beginning of the line.
177+
* To disable an extension, add a semicolon `;` at the beginning of the line.
178+
* If the extension line is missing, add it in this format: `extension=extension_name.so` (replace `extension_name.so` with the actual extension name).
179+
180+
3. Save the changes in the `default.ini` file.
181+
182+
#### Enabling a module through the configuration files
183+
184+
Typically, extensions with their own `.ini` files are enabled or disabled directly in those files, allowing more control for a specific PHP configuration.
185+
* 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.
186+
* If that does not work or you want to enable it on all systems by default, add it to `default.ini`.
187+
188+
1. Locate the extension’s `.ini` file (e.g., `memcached.ini`) in the directory:
189+
190+
<CodeWithCopy>
191+
192+
```
193+
/opt/alt/phpXY/etc/php.d.all/
194+
```
195+
</CodeWithCopy>
196+
197+
2. Open the file and find the lines starting with a semicolon `;` before the extension name (e.g., `;extension=memcached.so`).
198+
* The semicolon sign at the beginning of the line means that this extension is currently inactive. To enable an extension, remove the semicolon `;` at the beginning of the line.
199+
* To disable an extension, add a semicolon `;` at the beginning of the line.
200+
* If the extension line is missing, add the line:
201+
<CodeWithCopy>
202+
203+
```
204+
extension=memcached.so
205+
```
206+
207+
</CodeWithCopy>
208+
209+
3. Save the changes in the ini file.
210+
211+
#### Increase Upload/Memory Limits
212+
213+
If you need to increase memory and upload size limits:
214+
215+
1. Open the `default.ini` file in an editor of your choice.
216+
2. Set the limits as needed, e.g:
217+
218+
<CodeWithCopy>
219+
220+
```text
221+
upload_max_filesize=40M
222+
post_max_size=40M
223+
memory_limit=256M
224+
```
225+
226+
</CodeWithCopy>
227+
228+
153229
## Installation Instructions for Windows
154230
155231
### Get user credentials

0 commit comments

Comments
 (0)