Wordpress encoding issue after migrating to new server - wordpress

We've switched server for one of my client's website from a CentOS CPanel to a other CentOS CPanel We encountered some irregularities with accents and single quote.
For some reason, some characters are displaying as it should and some are not :
wrong encoding on different sentences
I've tried to change DB_CHARSET to utf8 and I've also tried to change table collation without success.
Website was running great on former server. Everything is wrong since we've changed it.
One of the users has issues connecting to the site as his user group switch every now and then. I don't know if it could be related ?
Any help would be very appreciated.

Try this to Fix Character Problem in WordPress:
As you know that latest Wordpress defined DB_CHARSET and DB_COLLATE values in wp-config.php. Which is actually the main reason behind this issue. To fix this issue just comment those two lines in wp-config.php file.
Open wp-config.php file and locate below lines
define(‘DB_CHARSET’, ‘utf8’);
define(‘DB_COLLATE’, ”);
Comment them out and Save that file. After commenting it should look like
//define('DB_CHARSET', 'utf8');
//define('DB_COLLATE', '');
Now upload the updated ‘wp-config.php’ file to your WebHost (overwriting the old one).
This character encoding problem can happen after a database upgrade too so it doesn’t hurt to keep this trick in your mind just in case.

You may experience an error when importing a WordPress .sql database from your old hosting to new.
So, Try again Export a .sql the database file manually via phpMyAdmin on your old host, then import the .sql to your new database. Try bellow steps;
Open phpMyAdmin & select your database
Click the "Export" tab for the database
Click the the "Custom" radio button - In the section titled "Format-specific options:", change the option for the "Database system or older MySQL server to maximize output compatibility with" from 'NONE' to 'MYSQL40'.
Scroll to the bottom and click "GO".
Now you should be able to import your .sql into phpMyAdmin in your control panel.

FYI, I've found the issue. It was server related.
I've checked the list of PHP extensions that were installed on my server and some were missing...
I don't have the exact list as there was a lot of them missing.
So, for those who have same issues, check your PHP version and extensions.

Related

Local By Flywheel - Error establishing a database connection

I was working on a website for a client a week ago and I came back to make further edits, but whenever I want to access the website, it reads:
Error establishing a database connection
I checked my wp-config file and everything is untouched; I did not touch one single line of code here when setting up my new Wordpress project in Local by Flywheel.
All my other local websites work except for this one. I've provided an image of my workspace just to make it more clear.
Looking at this image, the MySQL Version is a little bit off. The version should in fact be 5.6.37, but instead it's reading an older version of MySQL.
I did try closing and reopening Local by Flywheel, but it had no effect.
Any help appreciated. Thank you!
Right click on the site name and click on “Reveal in Finder” in Local by Flywheel.
Compress the folder containing all your site in a *.ZIP file (normally there must be at least the “app” and “logs” folder, sometimes “conf”).
In Local by Flywheel, import the site manually in FILE / IMPORT SITE, choose the Zip of your site
Normally, it reinstalls the site and recreates the Database … for me it’s work (on Windows and on Mac)
Are you able to compare your wp-config.php file in the broken site to a site that is using the same MySQL server?
I know you said that the file is untouched, but check again that all of the define parameters are correct.
Next I would suggest logging into your MySQL server using the credentials you have listed in the wp-config.php file and ensure you are able to access your database.

Cant Upload, Update, Install Plugins After cloning wordpress with backupbuddy

I've just migrated a client site to her production server using the latest version of BackupBuddy v3.0.40, and at first glance everything looks dandy, but on closer inspection, most WP file functions are borked: update wp, upload images, upload plugin.
I've done this a ton of times (several times on this host), and don't know why its not working here
I suspect it has to do with the tmp directory, but i can't see a problem..
another possibility is that a script (installatron via cpanel maybe interfering.. i notice that there are upload folders created for all months up to 2016! i read about this being a solution to permissions issues in WP's past)
This is what I've tried:
changing the wp-media upload location to the default, changing the 'store in year/month' setting and general wiggling. this was imported as '/home/###/public_html/wp-content/uploads' which looks correct, but unnecessary, the default is wp-content/uploads. neither work.
changing the permissions on wp-content and uploads dir to 777 (not all contents)
adding a line to wp-config.php:
define('WP_TEMP_DIR', ABSPATH . 'wp-content/'); no dice
uninstalled all traces of the installatron scripted wp installation (no files or db remain)
repeating the migration (same backup file, identical results)
confirming that:
i can create new posts, just not upload media
it works on the staging server (same host)
safe mode is off
apache is running as user, tx suPHP
the files were extracted by php via the browser
i've compared phpinfo to other working sites and dont notice anything out of the ordinary
hope you can shed some light!
thanks, Tim
image upload error:
“envelope-9887.jpg” has failed to upload due to an error
The uploaded file could not be moved to /home/###/public_html/wp-content/uploads/2012/07.
wordpress update error:
Download failed.: Destination directory for file streaming does not exist or is not writable.
plugin install error:
Download failed. Destination directory for file streaming does not exist or is not writable
sometimes when migrating you may have to look through the database options table and change a few entires, ie:
from the old site structure it could be: /home/yoursiteid/public_html/wp-content/ etc..
but on the new server the structure could have changed?
ie: /home/differentuserid/wwwroot/wp-content/
edit a file on the server to include :
echo getcwd() . "\n";
just to see if the home directory is the same as your current server or if its changed from your old sevrer, have a check in your database options table and update the entires which ref the old dir structure..
I found, eventually, that I'd overlook the line
define('WP_TEMP_DIR', 'old-hard-link-here');
which I believe was nestled directly under the wp salts, camoflaged to the tired eye! Simply removing that line and setting the media path to the default fixed the issue.
I believe that that line was installed by the cPanel script 'Installatron'.
Case closed

Creating a MAMP Local Copy of a Drupal 6 Website

We're currently rebranding a client of ours and it's come the time to take the new brand to their website.
I've not much experience with Drupal other than the theming (I've themed a Drupal website in the past but not very familiar with the software's inner workings).
As this website is live, it's obviously not feasible for me to make any changes to the live environment, so I have downloaded the source files of the website to a local webserver (MAMP).
I also have a MySQL dump of the database.
I'm not sure what files need to be changed inside Drupal to allow access to the MAMP webserver. Could somebody point me in the right direction here?
How would I connect the database to the website, which files need modification?
I think the client is running Drupal 6.
Update:
I've installed the database and linked it up using the below line:
$db_url = 'mysql://root#localhost/databasename';
I've hidden databasename for anonymity.
As it's MAMP, the database has no password. When I load up the website I get an error that install.php is not found. It's not there because the website is already 'installed'.
I've also updated the $base_url to read:
$base_url = 'http://localhost:8888/foldername';
You only need to modify one file, 'sites/default/settings.php'; you'll just need to change the database connection string in there to match your new database settings. There may be a couple of other settings in there you need to tweak depending on the set up of the site (for example the $base_url or $cookie_domain).
Other than that everything in your installation should be relatively path-ed so there shouldn't be any need to make more changes.
i was facing same problem after couple of hours try i got solution : we have to check the DB (tick on list of databases in local host) [ observe this after DB list : Enabling the database statistics here might cause heavy traffic between the web server and the MySQL server. so enable only the db you want to use] this will redirect to http://localhost:8888/foldername/install.php successfully :D :D

Upload plugins in Wordpress running on IIS7

I have a problem when trying to manually upload a new plugin in wordpress.
Uploading media is working perfectly, and also automatically install plugins work as it should, but manually uploading plugins generate an error message:
The uploaded file could not be moved to C:\inetpub\wwwroot\Wordpress/wp-content/uploads/2010/11.
I have checked permissions on wp-content and uploads and it is set to Everyone. I do not think there is anything wrong with permissions since I can upload images, and I see them inside my uploads folder.
I think there might be a problem with the slashes beeing incorrect, does anyone else have this problem?
I'm using IIS7, Windows Server 2008 and Wordpress 3.0.1. Everything is installed with Microsoft Web Platform Installer.
I know this is way late in answering, but I hope someone may find it useful.
This is most likely a problem with the settings involving the temporary upload location.
Here is what I did to solve a similar problem:
Ensure that you are editing the correct initialization file. Putting:
in a test.php file and executing it from your web browser will get you the setting.
Look for the setting for "Loaded Configuration File"
In that configuration file search for (or add if missing) the following setting:
upload_tmp_dir = "c:\inetpub\temp\uploads"
Ensure that c:\inetpub\temp\uploads exists and is writeable by everyone. You can tighten this up with specifying the IUSR account if you wish.
Recycle/Restart the IIS worker process. Your choice here as there are a number of ways to accomplish this.
I found a good bit of this info by referring to c:\tmp\php_errors.txt. The fastcgi.logging should be enabled by default on windows installations.
Just wanna add a solution to the good Harold's answer for PHP.
Despite changing the setting "upload_tmp_dir", I was still getting the same error message The uploaded file could not be moved to C:\inetpub\wwwroot\Wordpress/wp-content/uploads.
So i have changed also the setting "upload_max_filesize"
upload_max_filesize=16M
(16M or greater depending on the wordpress's themes size file)
Hope it helps someone who was stuck like me.
With Filezilla
directory uploads>2010>11 to set permision 777

Drupal to Drupal Migration

I am attempting to migrate hosts and am having issues migrating from one Drupal instance to another. I have a multi-site install. I am attempting to maintain the files/code as well as databases. I have transferred the files from the instance of Drupal from my old server to the new server. I have exported the databases via phpmyadmin and imported them back in with cli. For some reason the homepages for my sites work but the internal pages do not. When i try to navigate to a page I get The requested URL was not found. I have installed and ran a new instance of drupal 6 (same version) on the new server and it seems to work fine. I assume it is something I am doing wrong with the porting process? Any help greatly appreciated!
Did you transfer the .htaccess file(s) too ?
Those are "hidden" (their name is starting with a '.'), and not shown by default by some FTP transfer software...
(I've seen exactly this problem a couple of days ago, and getting the .htaccess from the old server and putting it on the new one saved the day ^^ so maybe you're having this problem too...)
You could have avoided that by only migrating the sites/ directory. Extract the latest version on your new server and copy the modules, themes, and settings from your old site. Of course the database will need to move also.
This assumes your site is up to date and you haven't modified the drupal core. You may have a custom install profile to copy over too.
There are some important things to keep in mind before migrating from one Drupal instance to another
1. Optimize the tables before exporting the database.
a) By clearing all the temporary tables
b) By removing website cache.
For more details go through the following link:
http://goldapplesoftware.ca/blog/2011-05-reducing-drupals-disk-temporary-table-usage
2. Export database with command line so no data is lost.
Check your httpd/apache conf file... be sure to add:
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>

Resources