problem on moving Wordpress website from Localhost to Server - wordpress

I ve created my wordpress website on local, then I hosted it using ovh and filezilla
I followed these steps
upload source files under www fileZilla
import my database on ovh
update wp-config
The problem is when i launch my site it still get css files from localhost nd showing this error
Failed to load resource: net::ERR_CONNECTION_REFUSED

You cannot import a WordPress database and have it just work because there are plenty of hard links (including hostname, in your case localhost) in it.
There are several ways to change the URL in the database. My favorite way is to use wp-cli ( https://wp-cli.org/ ) on the command line. Once installed and having the wp command inside your PATH, you can change (cd) to your WP installation's root directory (where the wp-config.php file is located) and run the following command:
wp search-replace 'http://localhost' 'https://your-new-domain.com' --export=my_wp_export.sql
Replace your-new-domain.com by whatever you're using on your ovh host. Be careful when selecting http or https depending on whether you have a valid SSL certificate in place and your hosting is correctly set up for HTTPS, or not.
You now have an SQL file where each localhost URL is replaced by your-new-domain.com. Next, upload and import the my_wp_export.sql file - everything should work.

Related

How do you specify a human-readable localhost url (i.e. localhost/loremipsum) for a local web app using Docker Desktop for Windows?

I'm just starting out with Docker for the first time as a replacement for XAMPP. All I'm doing is hosting a local instance of WordPress (and an associated MySQL database) on my (Win 11) laptop to use as a personal journal. I installed Docker Desktop and followed these instructions to create a compose file to install and run my WordPress instance. It worked fine, and when the image(?) is running, I can view my WordPress instance at localhost in a browser.
Before doing that, I tried out the docker tutorial, and I noticed that it forwarded to localhost/tutorial. I'd like to replicate that. How can I get my WordPress instance to map to something like localhost/example instead of just localhost?
Docker does not have routing based on path, this is up to your web server to configure different paths for root page (or root directory as WP calls it). That said it is basically a common change on wordpress URL Site URL if you want to as well the files location.
Here is the docs from WP on how to do it https://wordpress.org/support/article/giving-wordpress-its-own-directory/#method-ii-with-url-change. I'm going to rewrite just the steps that will change since you are using docker-compose that you created following the wordpress development environment article
1 - Create the new location for the core WordPress files to be stored (we will use /example in our examples). (On your Windows 11 create a new folder named example under ./wordpress)
2 - In WordPress address (URL): set the address of your main WordPress core files. Example: http://localhost/example
3 - In Site address (URL): set root directory’s URL. Example: http://localhost/example
8 - Open your root directory’s ./wordpress/index.php file in a text editor
9 - Change the following and save the file. Change the line that says: require __DIR__ . '/wp-blog-header.php'; to the following, using your directory name for the WordPress core files require __DIR__ . '/example/wp-blog-header.php';
10 - Login to the new location. It might now be http://localhost/example/wp-admin
Step 3 is optional, in case you want to change your site address as well. The rest of the steps are the same from the WP documentation, please follow that.
Now you can access WP or you site using http://localhost/example

Unable to make external HTTP connection from Google App Engine PHP 7.2 environment

I'm trying to use the WordPress Importer plugin to migrate my site to Google's App Engine, PHP 7.2 run time. This fails with the error:
Remote server did not respond'
How can I troubleshoot this further?
The WordPress Importer plugin is able to download media (images) through http(s) and add those to the local media files. This fails. When enabling the debug-mode on the Importer plugin, the error message becomes Remote server did not respond.
When I'm looking into the logs of my server, I don't see any tries to access the files at all, so somehow the instance running on AppEngine is not able to fetch the URL's.
One example URL is https://goingontheroad.nl/data/uploads//2009/09/oude_keuken_2.JPG - which works fine for me.
You need to enable curl:
https://cloud.google.com/appengine/docs/standard/php/issue-requests
In most cases, you can use CURLite to avoid charges.
For this:
Put php.ini in root dir (same as app.yaml), if not already
In php.ini add:
google_app_engine.enable_curl_lite = 1
deploy app.
If this now working, try replace on
extension = "curl.so"
But this need billing enabled

Running wordpress site different local host

I have recently taken my first programming project and it is with word press, I have never used it before as I have only done hard coding HTML/CSS before. My client has given me all of the files of her site, how do I run this on wordpress. I have installed wordpress and can run the test123 site but when I do the same thing on the local server with the info she gave me then I get a "Error establishing a database connection". This is surprising because all of the file folders in the info she gave me is the same as the test site (obv the content is different). She was doing it on a mac and I am on windows but I assume that hsouldn't matter. How can I fix this so I can see the site on wordpress and make the required changes that she wanted.
Thanks!
I tried changing the config file but that just gives me the setup again and not the site she has already made :(
First, create a folder into your htdocs folder with name test123
now put all the directory which one provide you by client in to test123 folder like wp-admin , wp-content ....etc
after then in new tab run this path
http://localhost/phpmyadmin/
Create a database with name something test , then import the database which one provide to you by your client , after import go to table name wp-options and change the site url http://localhost/test123 same for admin URL
Now back to your files and open wp-config.php file from your test123 folder root directory , change database name which one you recently created "test"
username set to "root" and password "blank" hostname should be "localhost"
now run path in to URL http://localhost/test123
after this if you want to login http://localhost/test123/wp-admin
then first you need to change user password with md5 strings from database wp-user table
the site will work on localhost
Here some change for wordpress project on host to other host .
in your sql file change host name example
to change
http://localhost
after change to your config file details.
installation WordPress in wamp server
first, start wamp server
click to start all services when it will work the icon will be colored green
Go to C:\wamp\www and paste WordPress folder there. You can rename the WordPress folder to anything you want for example test123
Now open a web browser and go to:
http://localhost/test123/
it will ask you for database connection error
now open the phpmyadmin as showing into create
a database and import the database
then go to you Wordpress folder test123 and find the wp-config.php file and replace your username with "root" database name you created , and password blank . now run http://localhost/test123/ once again
if not work then please come to chat box room.

How to change the default Wordpress upload folder to a shared network one?

I have a webserver setup in 2 separate pc's .
First machine holds the MySql server and folder for uploads, shared on the network, that i can access using UNC path like //PC1/uploads.
Second machine holds the ISS server and the Wordpress files.
I can use file:// to embed existing images, etc from the first machine in the wordpress site.
What I don't know is how to setup Wordpress to change it's default upload folder to //PC1/uploads instead of the default local folder.
I have tried with define('UPLOADS','file://PC1/uploads'); and with a ftp server
define ('UPLOADS','ftp://User:pass#pc1.ip');
I get and error Is its parent directory writable by the server?
The upload folder has Everyone read/write in permisions setting , and I can use mput to upload files with ftp.
Thank you
Turns out it was really simple.
Move the entire webroot on the shared folder, set the UNC path and credentials in ISS and define('WP_CONTENT_DIR,'\\\\ServerName\\SharedFolder\\'.'/wp-content');
The above answer isn't exactly right for WordPress 4.7. I got it with including both the following in wp-config.php:
define('WP_CONTENT_DIR','//server/sharedpath'.'/wp-content');
define( 'WP_CONTENT_URL', 'https://url-to-virtual-directory/wp-content' );

wordpress fresh install showing blank page

I am using linux. I downloaded wordpress zip file. I have a folder life.com and unzipped the wordpress contents in it.
I have created a virtual host life.com (its not a live site). its only accessible from my computer.
I set my apache web server and hosts so that life.com points to the folder.
When i open life.com it shows blank page. I just renames index.php to index1.php then it shows the contents of the folder life.com
I put a sample.php with hello. when i open life.com/sample.php it shows hello
there is no problem with the apache and php.
generally the fresh install of the wordpress should show the page
There doesn't seem to be a wp-config.php file. I need this before we can get started.
Need more help? We got it.
You can create a wp-config.php file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file.
Create a Configuration File
instead of opening life.com, i made a folder in the apache root directory /srv/wordpress and unzipped the files there.
when i open localhost/wordpress then it shows
There doesn't seem to be a wp-config.php file. I need this before we can get started.
Need more help? We got it.
You can create a wp-config.php file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file.
Create a Configuration File
its showing blank page when i open from virtual host (life.com) but opens correctly from localhost/wordpress.

Resources