Updated tools.func (markdown)
parent
61b1220bd0
commit
f083d5c7c9
@ -101,6 +101,89 @@ If no version is specified, the script will automatically fetch and install the
|
||||
|
||||
---
|
||||
|
||||
## install_mysql
|
||||
|
||||
### Description
|
||||
|
||||
`install_mysql()`:
|
||||
|
||||
- Detecting if MySQL is already installed
|
||||
- Replacing it with the specified version if it differs
|
||||
- Removing conflicting packages and cleaning up old sources
|
||||
- Setting up the official MySQL APT repository
|
||||
- Installing the MySQL server package
|
||||
|
||||
|
||||
### Usage
|
||||
|
||||
```bash
|
||||
install_mysql
|
||||
```
|
||||
To install a specific version of MySQL, export the `MYSQL_VERSION` variable before calling the function:
|
||||
|
||||
```bash
|
||||
MYSQL_VERSION="5.7" install_mysql
|
||||
```
|
||||
|
||||
### User-Configurable Variables
|
||||
|
||||
| Variable | Description | Default Value |
|
||||
|--------------|-----------------------------------------------------------------------------|---------------|
|
||||
| `MYSQL_VERSION` | Specifies the version of MySQL to install.. | `8.0`|
|
||||
|
||||
---
|
||||
|
||||
## install_php
|
||||
|
||||
### Description
|
||||
|
||||
`install_php()`:
|
||||
- Detects the current PHP version and upgrades or switches if necessary.
|
||||
- Adds the `sury.org` repository if not already configured.
|
||||
- Installs the specified PHP version along with default and user-defined modules.
|
||||
- Patches `php.ini` files with custom configuration values.
|
||||
- Optionally enables PHP for Apache or PHP-FPM.
|
||||
|
||||
### Usage
|
||||
|
||||
```bash
|
||||
install_php
|
||||
```
|
||||
You can set any of the environment variables below to customize the behavior:
|
||||
|
||||
```bash
|
||||
PHP_VERSION="8.3" PHP_APACHE="YES" PHP_FPM="NO" PHP_MEMORY_LIMIT="1G" install_php
|
||||
```bash
|
||||
|
||||
#### PHP Modules
|
||||
These modules are installed by default:
|
||||
```bash
|
||||
bcmath, cli, curl, gd, intl, mbstring, opcache, readline, xml, zip
|
||||
```
|
||||
You can add custom modules with this command:
|
||||
```bash
|
||||
PHP_MODULE="mysql,redis" install_php
|
||||
```
|
||||
### User-Configurable Variables
|
||||
|
||||
| Variable | Description | Default Value |
|
||||
|---------------------------|------------------------------------------------------------------------|---------------|
|
||||
| `PHP_VERSION` | PHP version to install (e.g., `8.2`, `8.3`, `8.4`) | `8.4` |
|
||||
| `PHP_MODULE` | Comma-separated list of additional PHP modules (e.g., `mysql,redis`) | *(empty)* |
|
||||
| `PHP_APACHE` | Set to `YES` to enable PHP module for Apache | `NO` |
|
||||
| `PHP_FPM` | Set to `YES` to install and configure PHP-FPM | `NO` |
|
||||
| `PHP_MEMORY_LIMIT` | Sets `memory_limit` in relevant `php.ini` files | `512M` |
|
||||
| `PHP_UPLOAD_MAX_FILESIZE` | Sets `upload_max_filesize` in relevant `php.ini` files | `128M` |
|
||||
| `PHP_POST_MAX_SIZE` | Sets `post_max_size` in relevant `php.ini` files | `128M` |
|
||||
| `PHP_MAX_EXECUTION_TIME` | Sets `max_execution_time` in relevant `php.ini` files | `300` |
|
||||
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user