A PHP Error was encountered

Severity: 8192

Message: Function create_function() is deprecated

Filename: geshi/geshi.php

Line Number: 4698

Backtrace:

File: /home/things/domains/anna.fyi/public_html/application/libraries/geshi/geshi.php
Line: 4698
Function: _error_handler

File: /home/things/domains/anna.fyi/public_html/application/libraries/geshi/geshi.php
Line: 4621
Function: _optimize_regexp_list_tokens_to_string

File: /home/things/domains/anna.fyi/public_html/application/libraries/geshi/geshi.php
Line: 1655
Function: optimize_regexp_list

File: /home/things/domains/anna.fyi/public_html/application/libraries/geshi/geshi.php
Line: 2029
Function: optimize_keyword_group

File: /home/things/domains/anna.fyi/public_html/application/libraries/geshi/geshi.php
Line: 2168
Function: build_parse_cache

File: /home/things/domains/anna.fyi/public_html/application/libraries/Process.php
Line: 45
Function: parse_code

File: /home/things/domains/anna.fyi/public_html/application/models/Pastes.php
Line: 517
Function: syntax

File: /home/things/domains/anna.fyi/public_html/application/controllers/Main.php
Line: 551
Function: getPaste

File: /home/things/domains/anna.fyi/public_html/index.php
Line: 315
Function: require_once

#!/bin/bash # Interactive WordPress Installation Script for cPanel servers # The ticket number *should* be a unique value for the MySQL db & username, but you can enter anything unique echo "!!!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!!!!" echo " This script does not have enough logic to be idiot proof." echo " Pay attention to what you're doing and don't be careless." echo "!!!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!!!!" echo " " # Prompt for the cPanel username read -p 'What is the cPanel username for the installation? ' CPANEL PRT=$(whmapi1 accountsummary user=$CPANEL | grep 'partition: ' | awk -F': ' '{print $2}') # Prompt for the ticket number read -p 'What is the ticket number (or something unique for the MySQL db & username)? ' TICKET # Confirm installation directory echo -n "Hit y to install the WP site in the default public_html; Otherwise hit n to enter a custom dir: " # Select and switch case use to structure an options selection loop. while (( !DIROPTDONE )); do read DIROPT case "$DIROPT" in y) DESTDIR="/$PRT/$CPANEL/public_html" DIROPTDONE=1 ;; n) read -p "Please specify the directory path to install to: " DESTDIR # This little bit strips the ending forward slash if present, and nothing if not DESTDIR=$(echo $DESTDIR | sed '$s%/$%%g') DIROPTDONE=1 ;; *) echo "Please choose a valid option (y or n)!" echo -n "Hit y to install the WP site in the default public_html; Otherwise hit n to enter a custom dir: " ;; esac done ############################################ # Gathering variables PREFIX=$(uapi --user=$CPANEL Mysql get_restrictions | grep prefix | awk '{ print $2 }') MYSQL=$PREFIX'wp' MYSQL+=$TICKET DOMAIN=$(grep -B2 $DESTDIR /usr/local/apache/conf/httpd.conf | grep ServerName | head -1 | awk -F' ' '{print $2}') ############################################ echo "****************************" echo "****Confirm installation****" echo "Target cPanel Account:" $CPANEL echo "Target Domain: "$DOMAIN echo "The MySQL database and username:" $MYSQL echo "Destination directory:" $DESTDIR echo "Current contents of the destination directory (empty if nothing listed):" ls -1 $DESTDIR read -p "Would you like to proceed with the WP installation? [y/n] " -n 1 -r if [[ ! $REPLY =~ ^[Yy]$ ]] then exit 1 fi echo " " # Generate a random pw for the MySQL db user MYSQLUSERPASS=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) # Create MySQL db & user echo "Creating MySQL user......................" uapi --user=$CPANEL Mysql create_user name=$MYSQL password=$MYSQLUSERPASS if [ "$?" -ne 0 ]; then echo "Error creating MySQL user!" exit 1 fi echo "Creating MySQL database......................" uapi --user=$CPANEL Mysql create_database name=$MYSQL if [ "$?" -ne 0 ]; then echo "Error creating MySQL database!" exit 1 fi echo "Setting privileges on database......................" uapi --user=$CPANEL Mysql set_privileges_on_database user=$MYSQL database=$MYSQL privileges=ALL if [ "$?" -ne 0 ]; then echo "Error setting MySQL privileges!" exit 1 fi # Download and extract the WP tarball, clean it up afterwards wget -qO- https://wordpress.org/latest.tar.gz | tar --strip-components=1 -xz -C $DESTDIR rm -f $DESTDIR/latest.tar.gz # Set up the initial wp-config file mv $DESTDIR/wp-config-sample.php $DESTDIR/wp-config.php # Set up the default WP .htaccess file cat >> $DESTDIR/.htaccess << "EOF" # BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPress EOF # Make sure everything is chowned to the cPanel user chown -R $CPANEL:$CPANEL $DESTDIR/* $DESTDIR/.* # Update Salts in the wp-config file SALT=$(curl -L https://api.wordpress.org/secret-key/1.1/salt/) STRING='put your unique phrase here' printf '%s\n' "g/$STRING/d" a "$SALT" . w | ed -s $DESTDIR/wp-config.php # Update wp-config file with MySQL info echo "*********************************" sed -i 's/database_name_here/'"$MYSQL"'/' $DESTDIR/wp-config.php sed -i 's/username_here/'"$MYSQL"'/' $DESTDIR/wp-config.php sed -i 's/password_here/'"$MYSQLUSERPASS"'/' $DESTDIR/wp-config.php echo "Here's the MySQL info in the wp-config.php file" grep -E 'DB_NAME|DB_USER|DB_PASSWORD' $DESTDIR/wp-config.php echo "*************************************************************" echo "WP installed, visit $DOMAIN to complete the installation" echo "*************************************************************"