WordPress

Reinstall mysql server using Ubuntu Terminal


To remove or uninstall Mysql Client Core 5.5 separately, I used the following commands:

sudo apt-get remove –purge mysql-server mysql-client mysql-common
sudo apt-get remove –purge mysql-client-core-5.5
sudo apt-get autoremove
sudo apt-get autoclean
sudo rm -rf /var/lib/mysql

Now install or reinstall mysql client and server:

sudo apt-get install mysql-server
sudo apt-get install mysql-client
sudo apt-get install mysql-workbench

Advertisements

Mysql crashed and won’t start up


  1. Stop mysqld.
  2. Backup /var/lib/mysql/ib*
  3. Add the following line into /etc/my.cnf

innodb_force_recovery = 1 (they suggest 4, but its best to start with 1 and increment if it won’t start)

  1. Restart mysqld.
  2. Dump all tables:# mysqldump -A > dump.sql
  3. Drop all databases which need recovery.
  4. Stop mysqld.
  5. Remove /var/lib/mysql/ib*
  6. Comment out innodb_force_recovery in /etc/my.cnf
  7. Restart mysqld. Look at mysql error log. By default it should be /var/lib/mysql/server/hostname.com.err to see how it creates new ib* files.
  8. Restore databases from the dump:mysql < dump.sql

file permissions for WordPress


When you setup WP you (the webserver) may need write access to the files. So the access rights may need to be loose.

chown www-data:www-data -R /var/www/html/* # Let Apache be owner
find /var/www/html -type d -exec chmod 755 {} \; # Change directory permissions rwxr-xr-x
find /var/www/html -type f -exec chmod 644 {} \; # Change file permissions rw-r–r–

After the setup you should tighten the access rights, according to Hardening WordPress all files except for wp-content should be writable by your user account only. wp-content must be writable by www-data too.

chown : -R * # Let your useraccount be owner
chown www-data:www-data wp-content # Let apache be owner of wp-content

Maybe you want to change the contents in wp-content later on. In this case you could

temporarily change to the user to www-data with su,
give wp-content group write access 775 and join the group www-data or
give your user the access rights to the folder using ACLs.
Whatever you do, make sure the files have rw permissions for www-data.

Increasing the WordPress Memory Limit


1. Edit your wp-config.php file and enter something like:

define('WP_MEMORY_LIMIT', '96M');

2. If you have access to your PHP.ini file, change the line in PHP.ini
If your line shows 32M try 64M:

memory_limit = 64M ; Maximum amount of memory a script may consume (64MB)


3. If you don’t have access to PHP.ini try adding this to an .htaccess file:

php_value memory_limit 64M

4. If none of the above works then talk to your host.

WordPress Manual Update


Manual Update

These are the short instructions, if you want more check out the extended upgrade instructions. If you experience problems with the Three Step Update, you may want to review the more detailed upgrade instructions

For these instructions, it is assumed that your blog’s URL is http://example.com/wordpress/.

Step 1: Replace WordPress files

  1. Get the latest WordPress zip (or tar.gz) file.
  2. Unpack the zip file that you downloaded.
  3. Deactivate plugins.
  4. Delete the old wp-includes and wp-admin directories on your web host (through your FTP or shell access).
  5. Using FTP or your shell access, upload the new wp-includes and wp-admin directories to your web host, in place of the previously deleted directories.
  6. Upload the individual files from the new wp-content folder to your existing wp-content folder, overwriting existing files. Do NOT delete your existing wp-content folder. Do NOT delete any files or folders in your existing wp-content directory (except for the one being overwritten by new files).
  7. Upload all new loose files from the root directory of the new version to your existing wordpress root directory.

NOTE – you should replace all the old WordPress files with the new ones in the wp-includes and wp-admin directories and sub-directories, and in the root directory (such as index.php, wp-login.php and so on). Don’t worry – your wp-config.php will be safe.

Be careful when you come to copying the wp-content directory. You should make sure that you only copy the files from inside this directory, rather than replacing your entire wp-content directory. This is where your themes and plugins live, so you will want to keep them. If you have customized the default or classic themes without renaming them, make sure not to overwrite those files, otherwise you will lose your changes. (Though you might want to compare them for new features or fixes..)

Lastly you should take a look at the wp-config-sample.php file, to see if any new settings have been introduced that you might want to add to your own wp-config.php.

Step 1.5: Remove .maintenance file

If you’re upgrading manually after a failed auto-upgrade, delete the file .maintenance from your WordPress directory using FTP. This will remove the “failed update” nag message.

Step 2: Update your installation

Visit your main WordPress admin page at /wp-admin. You may be asked to login again. If a database upgrade is necessary at this point, WordPress will detect it and give you a link to a URL like http://example.com/wordpress/wp-admin/upgrade.php. Follow that link and follow the instructions. This will update your database to be compatible with the latest code. You should do this as soon as possible after step 1.

Step 3: Do something nice for yourself

If you have caching enabled, your changes will appear to users more immediately if you clear the cache at this point (and if you don’t, you may get confused when you see the old version number in page footers when you check to see if the upgrade worked).

Your WordPress installation is successfully updated. That’s as simple as we can make it without Updating WordPress Using Subversion.

Consider rewarding yourself with a blog post about the update, reading that book or article you’ve been putting off, or simply sitting back for a few moments and letting the world pass you by.

Final Steps

Your update is now complete, so you can go in and enable your Plugins again. If you have issues with logging in, try clearing cookies in your browser.

Warning: file_get_contents(/home/coder4l6/public_html/wp-content/themes/enfold/config-layerslider/LayerSlider/sampleslider/sample_transitions.js) [function.file-get-contents]: failed to open stream: No such file or directory in /home/coder4l6/public_html/wp-content/themes/enfold/config-layerslider/LayerSlider/builder.php on line 14


Warning: file_get_contents(/home/coder4l6/public_html/wp-content/themes/enfold/config-layerslider/LayerSlider/sampleslider/sample_transitions.js) [function.file-get-contents]: failed to open stream: No such file or directory in /home/coder4l6/public_html/wp-content/themes/enfold/config-layerslider/LayerSlider/builder.php on line 14

Go to C:\xampp\htdocs\wordpress\wp-content\themes\enfold\config-layerslider\LayerSlider\builder.php

solution

// Get transition file
if(file_exists($custom_trs)) {
$data = file_get_contents($custom_trs);
} else {
$data = file_get_contents($sample_trs);
}

replace with

// Get transition file
if(file_exists($custom_trs)) {
$data = @file_get_contents($custom_trs);
} else {
$data = @file_get_contents($sample_trs);
}