|
| 1 | +# Frequently asked questions |
| 2 | + |
| 3 | +## How do I switch to a different version of PHP? |
| 4 | + |
| 5 | +Execute the following command: |
| 6 | + |
| 7 | +```shell |
| 8 | +sudo dnf module switch-to php:remi-{major}.{minor} -y |
| 9 | +``` |
| 10 | + |
| 11 | +where `{major}.{minor}` is one of the supported PHP versions: `8.4`, `8.3`, `8.2` and `8.1`. |
| 12 | + |
| 13 | +Additionally, our setup includes predefined aliases for executing the above command. |
| 14 | +The aliases are the following: |
| 15 | + |
| 16 | +* `php81`: switch to PHP 8.1 |
| 17 | +* `php82`: switch to PHP 8.2 |
| 18 | +* `php83`: switch to PHP 8.3 |
| 19 | +* `php84`: switch to PHP 8.4 |
| 20 | + |
| 21 | +After switching to a different PHP version, test with the following command: |
| 22 | + |
| 23 | +```shell |
| 24 | +php -v |
| 25 | +``` |
| 26 | + |
| 27 | +Depending on the selected PHP version, the output should look similar to the below: |
| 28 | + |
| 29 | +```text |
| 30 | +PHP 8.3.8 (cli) (built: Jun 4 2024 14:53:17) (NTS gcc x86_64) |
| 31 | +Copyright (c) The PHP Group |
| 32 | +Zend Engine v4.3.8, Copyright (c) Zend Technologies |
| 33 | +``` |
| 34 | + |
| 35 | +## How do I switch to a different version of Node.js? |
| 36 | + |
| 37 | +Execute the following commands: |
| 38 | + |
| 39 | +```shell |
| 40 | +sudo dnf remove nodejs -y |
| 41 | +curl -fsSL https://rpm.nodesource.com/setup_{major}.x | sudo bash - |
| 42 | +sudo dnf install nodejs -y |
| 43 | +``` |
| 44 | + |
| 45 | +where `{major}` is the Node.js version you want to switch to. |
| 46 | + |
| 47 | +Additionally, our setup includes predefined aliases for the above commands. |
| 48 | +The aliases are the following: |
| 49 | + |
| 50 | +* `node22`: switch to Node.js 22 |
| 51 | +* `node20`: switch to Node.js 20 |
| 52 | +* `node18`: switch to Node.js 18 |
| 53 | + |
| 54 | +After switching to a different Node.js version, test with the following command: |
| 55 | + |
| 56 | +```shell |
| 57 | +node -v |
| 58 | +``` |
| 59 | + |
| 60 | +## How do I fix common permission issues? |
| 61 | + |
| 62 | +If running your project, you encounter permission issues, follow the below steps. |
| 63 | + |
| 64 | +### Error |
| 65 | + |
| 66 | +> PHP Fatal error: Uncaught InvalidArgumentException: The directory "`<path-to-project>`/data" is not writable... |
| 67 | +
|
| 68 | +> PHP Fatal error: Uncaught InvalidArgumentException: The directory "`<path-to-project>`/data/cache" is not writable... |
| 69 | +
|
| 70 | +> PHP Fatal error: Uncaught InvalidArgumentException: The directory "`<path-to-project>`/data/cache/doctrine" is not writable... |
| 71 | +
|
| 72 | +### Solution |
| 73 | + |
| 74 | +```shell |
| 75 | +chmod -R 777 data |
| 76 | +``` |
| 77 | + |
| 78 | +### Error |
| 79 | + |
| 80 | +> PHP Fatal error: Uncaught InvalidArgumentException: The directory "`<path-to-project>`/public/uploads" is not writable... |
| 81 | +
|
| 82 | +### Solution |
| 83 | + |
| 84 | +```shell |
| 85 | +chmod -R 777 public/uploads |
| 86 | +``` |
| 87 | + |
| 88 | +### Error |
| 89 | + |
| 90 | +> PHP Fatal error: Uncaught ErrorException: fopen(`<path-to-project>`/log/error-log-yyyy-mm-dd.log): Failed to open stream: Permission denied... |
| 91 | +
|
| 92 | +### Solution |
| 93 | + |
| 94 | +```shell |
| 95 | +chmod -R 777 log |
| 96 | +``` |
| 97 | + |
| 98 | +## Where are the error log files? |
| 99 | + |
| 100 | +From time to time, you are encountering various errors which are not displayed. Or you can get errors 500 in a browser. |
| 101 | + |
| 102 | +To find the error messages, you need to read the error log files. |
| 103 | + |
| 104 | +### Apache log files |
| 105 | + |
| 106 | +```text |
| 107 | +/var/log/httpd/error_log |
| 108 | +``` |
| 109 | + |
| 110 | +### PHP-FPM log files |
| 111 | + |
| 112 | +```text |
| 113 | +/var/log/php-fpm/error.log |
| 114 | +/var/log/php-fpm/www-error.log |
| 115 | +``` |
| 116 | + |
| 117 | +## How do I update Composer? |
| 118 | + |
| 119 | +Before updating, check your current Composer version by executing: |
| 120 | + |
| 121 | +```shell |
| 122 | +composer --version |
| 123 | +``` |
| 124 | + |
| 125 | +The output should be similar to: |
| 126 | + |
| 127 | +```text |
| 128 | +Composer version 2.8.5 2025-01-21 15:23:40 |
| 129 | +PHP version 8.3.20 (/usr/bin/php) |
| 130 | +Run the "diagnose" command to get more detailed diagnostics output. |
| 131 | +``` |
| 132 | + |
| 133 | +Update Composer using its own `self-update` command: |
| 134 | + |
| 135 | +```shell |
| 136 | +sudo /usr/local/bin/composer self-update |
| 137 | +``` |
| 138 | + |
| 139 | +The output should be similar to: |
| 140 | + |
| 141 | +```text |
| 142 | +Upgrading to version 2.8.8 (stable channel). |
| 143 | +
|
| 144 | +Use composer self-update --rollback to return to version 2.8.5 |
| 145 | +``` |
| 146 | + |
| 147 | +After updating, check again your Composer version by executing: |
| 148 | + |
| 149 | +```shell |
| 150 | +composer --version |
| 151 | +``` |
| 152 | + |
| 153 | +The output should be similar to: |
| 154 | + |
| 155 | +```text |
| 156 | +Composer version 2.8.8 2025-04-04 16:56:46 |
| 157 | +PHP version 8.3.20 (/usr/bin/php) |
| 158 | +Run the "diagnose" command to get more detailed diagnostics output. |
| 159 | +``` |
| 160 | + |
| 161 | +## How do I update phpMyAdmin? |
| 162 | + |
| 163 | +Being installed as a system package, it can be updated using the command which updates the rest of the system packages: |
| 164 | + |
| 165 | +```shell |
| 166 | +sudo dnf upgrade -y |
| 167 | +``` |
| 168 | + |
| 169 | +## How do I create command aliases? |
| 170 | + |
| 171 | +From either your terminal or file explorer, navigate to your home directory (`/home/<your-username>/`). |
| 172 | + |
| 173 | +Using your preferred text editor, open the file: `.bash_profile` (if it does not exist, creat it first). |
| 174 | + |
| 175 | +Move to the end of the file and enter on a new line: |
| 176 | + |
| 177 | +```text |
| 178 | +alias command_alias="command to execute" |
| 179 | +``` |
| 180 | + |
| 181 | +where: |
| 182 | + |
| 183 | +* `command_alias` is the name by which you want to call your original command |
| 184 | +* `command to execute`: the original command to be executed on alias call |
| 185 | + |
| 186 | +### Example |
| 187 | + |
| 188 | +```text |
| 189 | +alias list_files="ls -Al" |
| 190 | +``` |
| 191 | + |
| 192 | +will create an alias called `list_files` that will run the command `ls -Al`. |
| 193 | + |
| 194 | +Then, you can execute your custom alias in a terminal just as a regular command: |
| 195 | + |
| 196 | +```shell |
| 197 | +list_files |
| 198 | +``` |
0 commit comments