1. Install php
pacman -S php php-apache
2. Edit apache configuration file
vim /etc/httpd/conf/httpd.conf
The result like following script
# LoadModule mpm_event_module modules/mod_mpm_event.so LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
3. Add following script into apache configuration file
# /lib/httpd/modules/libphp7.so # /etc/httpd/conf/extra/php7_module.conf LoadModule php7_module modules/libphp7.so Include conf/extra/php7_module.conf
4. Restart apache
systemctl restart httpd
MySQL/MariaDB
1. Install MariaDB (compatible with Mysql)
sudo pacman -Syu mariadb mariadb-clients libmariadbclient
2. Install the MariaDB data directory:
sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
3. Start MySQL and set it to run at boot:
sudo systemctl start mysqld.service sudo systemctl enable mysqld.service
4. Uncomment at least one of the following lines in /etc/php/php.ini:
extension=pdo_mysql.so extension=mysqli.so
5. Restart httpd
systemctl restart httpd
Reference:
- Apache HTTP Server
- systemd
- MySQL/MariaDB settings for php
- Apache HTTP Server
- LAMP Server on Arch Linux
- [教學]如何架設安裝WordPress部落格?
Q:
[freeman@localhost freeman]$ systemctl status httpd
● httpd.service - Apache Web Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2016-01-27 15:21:03 CST; 15s ago
Process: 15380 ExecStop=/usr/bin/httpd -k graceful-stop (code=exited, status=1/FAILURE)
Process: 15377 ExecStart=/usr/bin/httpd -k start -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 15377 (code=exited, status=1/FAILURE)
[freeman@localhost freeman]$ httpd -k start -DFOREGROUND
httpd: Syntax error on line 538 of /etc/httpd/conf/httpd.conf: Cannot load modules/libphp5.so into server: /etc/httpd/modules/libphp5.so: cannot open shared object file: No such file or directory
A:
vim /etc/httpd/conf/httpd.conf
From:
LoadModule php5_module modules/libphp5.so
Include conf/extra/php5_module.conf
To :
LoadModule php7_module modules/libphp7.so
Include conf/extra/php7_module.conf
Reference:
0 意見:
張貼留言