Wordpress guide: Difference between revisions
No edit summary |
|||
(19 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
= Wordpres Guide to not failing = | = Wordpres Guide to not failing = | ||
=== install wordpress and move it to the public_html === | |||
Pull the files and extract them: | |||
cd /home/CPUSER/public_html/ | |||
wget https://wordpress.org/latest.tar.gz | |||
tar -zxvf latest.tar.gz | |||
Move them up one directory: | |||
mv wordpress/* ./ | |||
rmdir wordpress | |||
Fix ownership problems: | |||
chown -R CPUSER. /home/CPUSER/public_html/* | |||
Create a database for the site, either do this from within cpanel account or from the cli with the following commands. | |||
mysqladmin create CPUSER_wrdp1 | |||
mysql -e "CREATE USER 'CPUSER_wrdp1'@'localhost' IDENTIFIED BY 'PASSWORD';" | |||
mysql -e "grant all privileges on CPUSER_wrdp1.* to 'CPUSER'@'localhost' identified by 'PASSWORD';"; | |||
Link db to cpanel account: | |||
/usr/local/cpanel/bin/dbmaptool brueggee --type mysql --dbs 'CPUSER_wrdp1' --dbusers 'CPUSER_wrdp1' | |||
Navigate to the domain, provide the database information and install wordpress. | |||
=== pulling the wordpress version for one site === | === pulling the wordpress version for one site === | ||
change directory into the sites wordpress installation. | change directory into the sites wordpress installation. | ||
grep "wp\_version\ \=" wp-includes/version.php | |||
=== pulling the wordpress version for all site's === | === pulling the wordpress version for all site's === | ||
updatedb && locate wp-includes/version.php > /home/wp-versions-list.txt | |||
more to come soon | |||
=== Reinstall core wordpress files --easymode === | |||
Run this and answer the questions. | |||
What | ==== '''Make sure you know the cpanel username and the full path to the wordpress install first''' ==== | ||
(echo;function getinfo { read -p "What is the cpanel account username?: " _cpuser;read -p "Where does the wordpress install live?(no trailing /): " pAth;_WPverZ=`grep "wp\_version\ \=" $pAth/wp-includes/version.php | grep -o [0-9].[0-9].[0-9]`;echo;echo -e "\t$pAth\n\t$_cpuser\n\t$_WPverZ\n"; read -p "Does the above info look correct?(answer y or n)" _YoN; chkinfo;}; function chkinfo { if [ $_YoN = n ] || [ -z $_YoN ]; then getinfo; fi;}; getinfo; date=`date +%Y-%m-%d-%H-%M`; mkdir -p /home/temp/wpnew-$date;cd /home/temp/wpnew-$date; wget -q http://wordpress.org/wordpress-$_WPverZ.tar.gz; tar -zxf wordpress-$_WPverZ.tar.gz; echo "Moving the old files to .broke..."; mv $pAth/wp-admin $pAth/wp-admin.broke; mv $pAth/wp-includes $pAth/wp-includes.broke; mv $pAth/wp-settings.php $pAth/wp-settings.php.broke;echo "Copying the new files from the fresh tar file..."; cp -Rp /home/temp/wpnew-$date/wordpress/wp-admin $pAth/wp-admin; cp -Rp /home/temp/wpnew-$date/wordpress/wp-includes $pAth/wp-includes; cp -Rp /home/temp/wpnew-$date/wordpress/wp-settings.php $pAth/wp-settings.php; echo "Correcting permissions on the newly placed files...";chown $_cpuser.$_cpuser $pAth/wp-settings.php; chown -R $_cpuser.$_cpuser $pAth/wp-includes; chown -R $_cpuser.$_cpuser $pAth/wp-admin) | |||
===== This is what that code block above does ===== | |||
(echo; | |||
function getinfo { read -p "What is the cpanel account username?: " _cpuser; | |||
read -p "Where does the wordpress install live?(no trailing /): " pAth; | |||
_WPverZ=`grep "wp\_version\ \=" $pAth/wp-includes/version.php | grep -o [0-9].[0-9].[0-9]`; | |||
echo; | |||
echo -e "\t$pAth\n\t$_cpuser\n\t$_WPverZ\n"; | |||
read -p "Does the above info look correct?(answer y or n)" _YoN; | |||
chkinfo; | |||
}; | |||
function chkinfo { if [ $_YoN = n ] || [ -z $_YoN ]; | |||
then getinfo; | |||
fi; | |||
}; | |||
getinfo; | |||
date=`date +%Y-%m-%d-%H-%M`; | |||
mkdir -p /home/temp/wpnew-$date; | |||
cd /home/temp/wpnew-$date; | |||
wget -q http://wordpress.org/wordpress-$_WPverZ.tar.gz; | |||
tar -zxf wordpress-$_WPverZ.tar.gz; | |||
echo "Moving the old files to .broke..."; | |||
mv $pAth/wp-admin $pAth/wp-admin.broke; | |||
mv $pAth/wp-includes $pAth/wp-includes.broke; | |||
mv $pAth/wp-settings.php $pAth/wp-settings.php.broke; | |||
echo "Copying the new files from the fresh tar file..."; | |||
cp -Rp /home/temp/wpnew-$date/wordpress/wp-admin $pAth/wp-admin; | |||
cp -Rp /home/temp/wpnew-$date/wordpress/wp-includes $pAth/wp-includes; | |||
cp -Rp /home/temp/wpnew-$date/wordpress/wp-settings.php $pAth/wp-settings.php; | |||
echo "Correcting permissions on the newly placed files..."; | |||
chown $_cpuser.$_cpuser $pAth/wp-settings.php; | |||
chown -R $_cpuser.$_cpuser $pAth/wp-includes; | |||
chown -R $_cpuser.$_cpuser $pAth/wp-admin) | |||
=== Reinstall core wordpress files -- | === Reinstall core wordpress files --manual mode === | ||
Set the UsEr variable below to your cpanel accounts user name. | Set the UsEr variable below to your cpanel accounts user name. | ||
Line 31: | Line 77: | ||
http://wordpress.org/download/release-archive/ - Wordpress download archives. | http://wordpress.org/download/release-archive/ - Wordpress download archives. | ||
Set some variables: | |||
WPverZ=`grep "wp\_version\ \=" | pAth=(enter full path to install here, no trailing /) | ||
cpuser=(cpanel username) | |||
WPverZ=`grep "wp\_version\ \=" $pAth/wp-includes/version.php | grep -o [0-9].[0-9].[0-9]` | |||
Make sure all of those are set: | |||
echo $pAth $cpuser $WPverZ | |||
Beging the move: | |||
mkdir -p /home/temp/wpnew | mkdir -p /home/temp/wpnew | ||
cd /home/temp/wpnew | cd /home/temp/wpnew | ||
wget http://wordpress.org/wordpress-$WPverZ.tar.gz | wget http://wordpress.org/wordpress-$WPverZ.tar.gz | ||
tar -zxvf wordpress-$WPverZ.tar.gz | tar -zxvf wordpress-$WPverZ.tar.gz | ||
mv | mv $pAth/wp-admin $pAth/wp-admin.broke | ||
mv | mv $pAth/wp-includes $pAth/wp-includes.broke | ||
mv | mv $pAth/wp-settings.php $pAth/wp-settings.php.broke | ||
cp -Rp /home/temp/wpnew/wordpress/wp-admin | cp -Rp /home/temp/wpnew/wordpress/wp-admin $pAth/wp-admin | ||
cp -Rp /home/temp/wpnew/wordpress/wp-includes | cp -Rp /home/temp/wpnew/wordpress/wp-includes $pAth/wp-includes | ||
cp -Rp /home/temp/wpnew/wordpress/wp-settings.php | cp -Rp /home/temp/wpnew/wordpress/wp-settings.php $pAth/wp-settings.php | ||
Now from here out you have to know your handler for permissions. | Now from here out you have to know your handler for permissions. | ||
/usr/local/cpanel/bin/rebuild_phpconf --current | |||
For DSO | For DSO | ||
chown -R $ | chown -R $cpuser.nobody $pAth | ||
For SUPHP | For SUPHP | ||
chown -R $ | chown -R $cpuser. $pAth | ||
chown $ | chown $cpuser.nobody $pAth | ||
=== Fatal error undefined function is_network_admin() === | |||
Aquired from this site [http://euvidente.blogspot.com/2011/03/fatal-error-undefined-function.html here] | |||
<pre> | |||
Hi, recently I tried to update my WordPress blog and then, when I try to get access to admin, I got the following error: | |||
Fatal error undefined function is_network_admin() | |||
Actually to fix this, is very simple, Just download the most recent version of wordpress from the original source (http://wordpress.org/download) save it on your pc, extract the files to any directory (could be something like c:/wp) | |||
Log-in into your ftp account, rename the 2 following directories (wp-admin, wp-includes) to any other name (such as wp-admin-old and wp-includes-old) and then upload the respective directories from the extracted files. | |||
Almost done. | |||
Last thing to do, just look for a file called "wp-settings.php" and upload it to your blog folder (the same that contains wp-config.php file) and if everything works all okay, feel free to remove the 2 firstly renamed folders as the wordpress doesn't need them. | |||
And now you are done! | |||
</pre> | |||
What this equates to is that the user tried to update wordpress and it either died halfway or they got impatient and canceled it. The fix is below, Last time I did this it was on a dso server and the commands looked like what follows. | |||
GO TO [[Wordpress_guide#Reinstall_core_wordpress_files_--easymode]] |
Latest revision as of 03:50, 14 October 2020
Wordpres Guide to not failing
install wordpress and move it to the public_html
Pull the files and extract them:
cd /home/CPUSER/public_html/ wget https://wordpress.org/latest.tar.gz tar -zxvf latest.tar.gz
Move them up one directory:
mv wordpress/* ./ rmdir wordpress
Fix ownership problems:
chown -R CPUSER. /home/CPUSER/public_html/*
Create a database for the site, either do this from within cpanel account or from the cli with the following commands.
mysqladmin create CPUSER_wrdp1 mysql -e "CREATE USER 'CPUSER_wrdp1'@'localhost' IDENTIFIED BY 'PASSWORD';" mysql -e "grant all privileges on CPUSER_wrdp1.* to 'CPUSER'@'localhost' identified by 'PASSWORD';";
Link db to cpanel account:
/usr/local/cpanel/bin/dbmaptool brueggee --type mysql --dbs 'CPUSER_wrdp1' --dbusers 'CPUSER_wrdp1'
Navigate to the domain, provide the database information and install wordpress.
pulling the wordpress version for one site
change directory into the sites wordpress installation.
grep "wp\_version\ \=" wp-includes/version.php
pulling the wordpress version for all site's
updatedb && locate wp-includes/version.php > /home/wp-versions-list.txt
more to come soon
Reinstall core wordpress files --easymode
Run this and answer the questions.
Make sure you know the cpanel username and the full path to the wordpress install first
(echo;function getinfo { read -p "What is the cpanel account username?: " _cpuser;read -p "Where does the wordpress install live?(no trailing /): " pAth;_WPverZ=`grep "wp\_version\ \=" $pAth/wp-includes/version.php | grep -o [0-9].[0-9].[0-9]`;echo;echo -e "\t$pAth\n\t$_cpuser\n\t$_WPverZ\n"; read -p "Does the above info look correct?(answer y or n)" _YoN; chkinfo;}; function chkinfo { if [ $_YoN = n ] || [ -z $_YoN ]; then getinfo; fi;}; getinfo; date=`date +%Y-%m-%d-%H-%M`; mkdir -p /home/temp/wpnew-$date;cd /home/temp/wpnew-$date; wget -q http://wordpress.org/wordpress-$_WPverZ.tar.gz; tar -zxf wordpress-$_WPverZ.tar.gz; echo "Moving the old files to .broke..."; mv $pAth/wp-admin $pAth/wp-admin.broke; mv $pAth/wp-includes $pAth/wp-includes.broke; mv $pAth/wp-settings.php $pAth/wp-settings.php.broke;echo "Copying the new files from the fresh tar file..."; cp -Rp /home/temp/wpnew-$date/wordpress/wp-admin $pAth/wp-admin; cp -Rp /home/temp/wpnew-$date/wordpress/wp-includes $pAth/wp-includes; cp -Rp /home/temp/wpnew-$date/wordpress/wp-settings.php $pAth/wp-settings.php; echo "Correcting permissions on the newly placed files...";chown $_cpuser.$_cpuser $pAth/wp-settings.php; chown -R $_cpuser.$_cpuser $pAth/wp-includes; chown -R $_cpuser.$_cpuser $pAth/wp-admin)
This is what that code block above does
(echo; function getinfo { read -p "What is the cpanel account username?: " _cpuser; read -p "Where does the wordpress install live?(no trailing /): " pAth; _WPverZ=`grep "wp\_version\ \=" $pAth/wp-includes/version.php | grep -o [0-9].[0-9].[0-9]`; echo; echo -e "\t$pAth\n\t$_cpuser\n\t$_WPverZ\n"; read -p "Does the above info look correct?(answer y or n)" _YoN; chkinfo; }; function chkinfo { if [ $_YoN = n ] || [ -z $_YoN ]; then getinfo; fi; }; getinfo; date=`date +%Y-%m-%d-%H-%M`; mkdir -p /home/temp/wpnew-$date; cd /home/temp/wpnew-$date; wget -q http://wordpress.org/wordpress-$_WPverZ.tar.gz; tar -zxf wordpress-$_WPverZ.tar.gz; echo "Moving the old files to .broke..."; mv $pAth/wp-admin $pAth/wp-admin.broke; mv $pAth/wp-includes $pAth/wp-includes.broke; mv $pAth/wp-settings.php $pAth/wp-settings.php.broke; echo "Copying the new files from the fresh tar file..."; cp -Rp /home/temp/wpnew-$date/wordpress/wp-admin $pAth/wp-admin; cp -Rp /home/temp/wpnew-$date/wordpress/wp-includes $pAth/wp-includes; cp -Rp /home/temp/wpnew-$date/wordpress/wp-settings.php $pAth/wp-settings.php; echo "Correcting permissions on the newly placed files..."; chown $_cpuser.$_cpuser $pAth/wp-settings.php; chown -R $_cpuser.$_cpuser $pAth/wp-includes; chown -R $_cpuser.$_cpuser $pAth/wp-admin)
Reinstall core wordpress files --manual mode
Set the UsEr variable below to your cpanel accounts user name.
Also these direction are assuming that the install is in the public_html, adjust accordingly
http://wordpress.org/download/release-archive/ - Wordpress download archives.
Set some variables:
pAth=(enter full path to install here, no trailing /) cpuser=(cpanel username) WPverZ=`grep "wp\_version\ \=" $pAth/wp-includes/version.php | grep -o [0-9].[0-9].[0-9]`
Make sure all of those are set:
echo $pAth $cpuser $WPverZ
Beging the move:
mkdir -p /home/temp/wpnew cd /home/temp/wpnew wget http://wordpress.org/wordpress-$WPverZ.tar.gz tar -zxvf wordpress-$WPverZ.tar.gz mv $pAth/wp-admin $pAth/wp-admin.broke mv $pAth/wp-includes $pAth/wp-includes.broke mv $pAth/wp-settings.php $pAth/wp-settings.php.broke cp -Rp /home/temp/wpnew/wordpress/wp-admin $pAth/wp-admin cp -Rp /home/temp/wpnew/wordpress/wp-includes $pAth/wp-includes cp -Rp /home/temp/wpnew/wordpress/wp-settings.php $pAth/wp-settings.php
Now from here out you have to know your handler for permissions.
/usr/local/cpanel/bin/rebuild_phpconf --current
For DSO
chown -R $cpuser.nobody $pAth
For SUPHP
chown -R $cpuser. $pAth chown $cpuser.nobody $pAth
Fatal error undefined function is_network_admin()
Aquired from this site here
Hi, recently I tried to update my WordPress blog and then, when I try to get access to admin, I got the following error: Fatal error undefined function is_network_admin() Actually to fix this, is very simple, Just download the most recent version of wordpress from the original source (http://wordpress.org/download) save it on your pc, extract the files to any directory (could be something like c:/wp) Log-in into your ftp account, rename the 2 following directories (wp-admin, wp-includes) to any other name (such as wp-admin-old and wp-includes-old) and then upload the respective directories from the extracted files. Almost done. Last thing to do, just look for a file called "wp-settings.php" and upload it to your blog folder (the same that contains wp-config.php file) and if everything works all okay, feel free to remove the 2 firstly renamed folders as the wordpress doesn't need them. And now you are done!
What this equates to is that the user tried to update wordpress and it either died halfway or they got impatient and canceled it. The fix is below, Last time I did this it was on a dso server and the commands looked like what follows.
GO TO Wordpress_guide#Reinstall_core_wordpress_files_--easymode