pacman -Syu
pacman -S yaourt
yaourt -Syy
pacman -S apache
Sửa /etc/httpd/conf/httpd.conf
#LoadModule mpm_event_module modules/mod_mpm_event.so
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
LoadModule rewrite_module modules/mod_rewrite.so
và thêm vào cuối:
LoadModule php7_module modules/libphp7.so
AddHandler php7-script php
Include conf/extra/php7_module.conf
Khởi chạy:
systemctl enable httpd
systemctl start httpd
pacman -S mysql
Chọn mariadb
Cấu hình cho MariaDB:
mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
Khởi chạy:
systemctl start mariadb
Cài đặt bảo mật:
mysql_secure_installation
Xóa password (tùy thích):
mysqladmin -u root -p'root' password ''
pacman -S php php-apache
Tạo thư mục trong $HOME
:
mkdir $HOME/public_html
Phân quyền:
chmod 711 $HOME
chmod 755 $HOME/public_html
systemctl restart httpd
Trong public_html
, tạo index.php
:
<?php
phpinfo();
?>
yaourt -S php-phalcon
Sửa /etc/php/php.ini
:
extension=gettext
extension=pdo_mysql
yaourt -S phalcon-devtools
pacman -S composer
yaourt -S php-xdebug
Sửa /etc/php/conf.d/xdebug.ini
:
zend_extension=xdebug.so
xdebug.remote_enable=on
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
Cài thêm tiện ích Xdebug helper cho Chrome hoặc Firefox.
cd $HOME/public_html
phalcon project demo --template-engine=volt
chmod -R 777 demo/cache
Tạo thư mục trong public_html
:
mkdir $HOME/public_html/adminer
Tải Adminer:
wget -O index.php https://github.com/vrana/adminer/releases/download/v4.6.2/adminer-4.6.2-mysql-en.php
Sửa /etc/php/php.ini
:
extension=mysqli
Sửa /etc/httpd/conf/httpd.conf
:
Include conf/extra/httpd-vhosts.conf
Thêm vào /etc/httpd/conf/extra/httpd-vhosts.conf
:
<VirtualHost *:80>
DocumentRoot "/home/USERNAME/public_html/adminer/"
ServerName "adminer.localhost"
</VirtualHost>
define ROOT "/home/USERNAME/public_html/HOSTNAME"
define SITE "HOSTNAME.localhost"
<VirtualHost *:80>
DocumentRoot "${ROOT}"
ServerName ${SITE}
ServerAlias *.${SITE}
<Directory "${ROOT}">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>