Jump to content

Do you trick your local web server?


Boost
 Share

Recommended Posts

Hey,

What is your strategy for local development? For example, if you're converting a WordPress website to ProcessWire - let's say the website is acme.com - do you set up your development web server to use acme.com using the 127.0.0.1 trick?

Link to comment
Share on other sites

@BoostGuess you talk about converting WordPress site to PW site - right? Would just develop as usual using localhost for the new PW site and then just upload stuff to the server once ready. Usually I have three site/config.php files (config.php, config_server.php, config_local.php) which just differ in the DB credentials and the root host. 

Once my localhost PW site is up and running, I zip it (.htaccess, index.php, site/ and wire/) and upload the zip file to my server via Ftp together with a simple PHP unzip script. Then I run the unzip script on the server. Than I cooy/rename site/config_server.php to config.php). Last step is to enter my server PhpMyAdmin and just delete old DB tables and import the sql dump from localhost.

  • Like 1
Link to comment
Share on other sites

20 hours ago, Boost said:

What is your strategy for local development? For instance, when you're converting a WordPress website to ProcessWire - let's say the website is acme.com - do you set up your development web server to use acme.com using the 127.0.0.1 trick?

I'm using DDEV, so every project has it's own URL like myproject.ddev.site https://processwire.com/talk/topic/27433-using-ddev-for-local-processwire-development-tips-tricks/

That works great for PW but not sure if that also works for WordPress as I heard it does weird things with hardcoded hosts all over?!

Link to comment
Share on other sites

7 minutes ago, bernhard said:

That works great for PW but not sure if that also works for WordPress as I heard it does weird things with hardcoded hosts all over?!

About handling the hardcoded URLs in WP, there was this: WordPress sucks and I want to kick you in your teeth! - Page 5 - Beer Garden - ProcessWire Support Forums

I'm still using MAMP PRO with .local URLs. It has it's limits, eg. with the choice of DBs, PHP versions etc. I guess I'll switch to DDEV, too, one day...

Link to comment
Share on other sites

For WordPress sites I used the Plugin Better Search Replace to replace hardcoded Urls when transferring Sql dumps from localhost to my live server and vice versa. For other CMS I just opened the Sql dump in Notepad++ and did a search/replace of Urls to match right host. 

  • Like 1
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...