Here's a quick and dirty installation script for Wordpress running on FAMP.
(use at your own risk)
Comments welcome.
I know, there's no security or checking for errors, but, it's quick and dirty
You can check if it has worked by:-
(use at your own risk)
Code:
#install pkgs
cat << EOF | xargs pkg install -y
apache24
mod_php73
php73-mysqli
mysql56-server
php73-xml
php73-hash
php73-gd
php73-curl
php73-tokenizer
php73-zlib
php73-zip
EOF
#configure php
cat <<EOF >/usr/local/etc/apache24/Includes/php.conf
<IfModule dir_module>
DirectoryIndex index.php index.html
<FilesMatch "\.php$">
SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch "\.phps$">
SetHandler application/x-httpd-php-source
</FilesMatch>
</IfModule>
EOF
echo '<?php phpinfo(); ?>' > /usr/local/www/apache24/data/info.php
#configure apache mysql
sysrc apache24_enable=YES
sysrc mysql_enable=YES
#service apache24 start
service mysql-server start
#install wordpress database in mysql
mysql -u root <<EOF
CREATE DATABASE wordpress;
CREATE USER wp_user@localhost IDENTIFIED BY 'wp_pass';
GRANT ALL PRIVILEGES ON wordpress.* TO wp_user@localhost;
FLUSH PRIVILEGES;
exit
EOF
#install wordpress
cd /usr/local/www/apache24/data
fetch -o - https://wordpress.org/latest.tar.gz | tar xSf -
#configure wordpress
cd wordpress
sed -e 's/database_name_here/wordpress/' -e 's/username_here/wp_user/' -e 's/password_here/wp_pass/' wp-config-sample.php >wp-config.php
chown -R www:www /usr/local/www/apache24/data/wordpress/*
service apache24 start
Comments welcome.
I know, there's no security or checking for errors, but, it's quick and dirty
You can check if it has worked by:-