Устанавливаю виртуальный сервер на Monjaro
Не знаю в каких файлах по каким директория менять содержание по пункту 3,
sudo pacman -Syu
sudo pacman -S php php-fpm
You can install common PHP extensions as needed, for example:
Код
sudo pacman -S php-gd php-curl php-intl php-json php-mysqli php-xmlrpc
2. Configure PHP-FPM:
After installation, enable and start the php-fpm service:
Код
sudo systemctl enable php-fpm
sudo systemctl start php-fpm
3. Configure Web Server (Nginx or Apache):
Nginx Configuration:
Create a server block configuration for your virtual host, pointing to the php-fpm socket.
Код
server {
listen 80;
server_name your_domain.com; # Replace with your domain or IP
root /path/to/your/webroot; # Replace with your webroot directory
index index.php index.html index.htm;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php-fpm/php-fpm.sock; # Or tcp:127.0.0.1:9000 if configured
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Apache Configuration:
Ensure mod_php or mod_proxy_fcgi (for FPM) is enabled and configure your virtual host.
Код
ServerName your_domain.com # Replace with your domain or IP
DocumentRoot /home/admin/Документы/drupal/ # Replace with your webroot directory
AllowOverride All
Require all granted
SetHandler "proxy:unix:/run/php-fpm/php-fpm.sock|fcgi://localhost/" # Or tcp:127.0.0.1:9000
4. Restart Web Server:
After configuring your web server, restart its service:
Код
sudo systemctl restart nginx # Or apache2
5. Test PHP:
Create a simple info.php file in your webroot:
Код
<?php
phpinfo();
?>
Что-то пошло не так.
Комментарии
Мне это помогло.
https://niklan.net/blog/docker4drupal-ubuntu
Но иснтрукция слегка устрела.
В ИИ надо вопросы вставлють - тогда корректирует.
Для локальной разработки рекомендую DDEV, который ставится одной командой:
curl -fsSL https://ddev.com/install.sh | bash
Документация по установке:
https://ddev.readthedocs.io/en/stable/users/install/ddev-installation/#l...