News for hackers. Stuff that matters.
Re:I tried to use WordPress with GitHub Pages by frereubu on Sunday August 16, 2020 @05:33PM (#24181531)
"running WordPress locally is a nightmare... I should also caveat that I know almost nothing about Apache, MySQL, FTP, and PHP."

Without wishing to be too snarky, this could be rewritten as "Running this software is a nightmare if you know nothing about the technologies it is built on." And being slightly more snarky, my response would be: well, duh.

Re:I tried to use WordPress with GitHub Pages by oneeyedpigeon on Sunday August 16, 2020 @05:59PM (#24181725)
I think your response would be unfair. If you think about the statement "running this software is a nightmare if you know nothing about the technologies it is built on" outside of this context, it clearly doesn't typically apply. You wouldn't apply that to using a web browser or a word processor, right? Should 'blog writing' software really have such a greater barrier of entry?
Re:I tried to use WordPress with GitHub Pages by macspoofing on Sunday August 16, 2020 @06:11PM (#24181798)
>I think your response would be unfair.

I don't think so. The author actually gave themselves a weird goal - to use Wordpress as the text editor, and export/copy the static content to github. I'm not sure why they would do that, but OK! In the end, their problem wasn't with the workflow but with setting up local version of Wordpress (why? why not use a hosted version of Wordpress????), PHP, Apache, MySQL and FTP(!!).

WordPress isn't actually that hard to setup. It's a little harder on Windows, because setting up PHP on Windows just isn't as natural as on Linux but XAMPP makes it as easy as possible.

>Should 'blog writing' software really have such a greater barrier of entry?

But it doesn't. You have a plethora of (free) hosted blogging solutions. You could also get private hosting with the LAMP stack already pre-installed and configured.

Re:I tried to use WordPress with GitHub Pages by manigandham on Sunday August 16, 2020 @06:17PM (#24181839)
Why someone would do this: Wordpress has a solid editor, lots of plugins, and is used by millions so the workflow is well tested. The resulting pages are a perfect fit as static content.

You can accomplish this by using a CDN that caches everything, or use plugins that export static files like WP2Static, or use integrations with static site frameworks like Gatsby that treat WP as a CMS.

But yes, doing it all from scratch yourself is probably not worth it, especially if you're unfamiliar with the tech.

Re:I tried to use WordPress with GitHub Pages by macspoofing on Sunday August 16, 2020 @07:49PM (#24182400)
>Why someone would do this: Wordpress has a solid editor, lots of plugins, and is used by millions so the workflow is well tested.

Sure - why not. The question, why do you need to host it locally? You can just create a free account on wordpress.com, or get a private hosted solution for peanuts and with the LAMP stack already configured.

Re:I tried to use WordPress with GitHub Pages by disgruntledphd2 on Monday August 17, 2020 @06:56AM (#24185993)
But to be fair, the authors core point is correct - running Wordpress locally and then deploying to the internet is an absolute tire-fire.

For context my wife uses wordpress to build various sites. I got lumped with the task of moving this online. It was super painful, as WP encodes the URL name (i.e. localhost) flipping everywhere.

I eventually resolved this by editing the tables which stored the URLS (fortunately, as a DS I know SQL) and doing some sed on various files that cached the URL.

I now refuse to do this, and set her up online with a website before she does any work, because moving it is so painful.

Re:I tried to use WordPress with GitHub Pages by hunter2_ on Monday August 17, 2020 @07:37AM (#24186229)
Re:I tried to use WordPress with GitHub Pages by disgruntledphd2 on Monday August 17, 2020 @08:13AM (#24186458)
Many packages store the raw URLs in the DB, and don't respect the change of that setting. At least that was my experience.

I did try the obvious things first, to be fair.

Re:I tried to use WordPress with GitHub Pages by tacone on Tuesday August 18, 2020 @10:37AM (#24199083)
You need to use wp-cli to carefully find and replace urls and filesystem paths inside the db. Many professionals don't even know about it.

Another way is to perform the find and replace with PhpMyAdmin.

Re:I tried to use WordPress with GitHub Pages by tacone on Tuesday August 18, 2020 @10:40AM (#24199117)
Forget what I said about PhpMyAdmin, you can't edit serialized blobs easily. Wp-cli is the way to do it.
Re:I tried to use WordPress with GitHub Pages by disgruntledphd2 on Tuesday August 18, 2020 @11:04AM (#24199510)
Or you could just use SQL (which is what I did).
Re:I tried to use WordPress with GitHub Pages by tacone on Thursday August 20, 2020 @11:29AM (#24224253)
No, you would invalidate all PHP serialized blobs. Things may keep working, but you would lose some config/data.
Re:I tried to use WordPress with GitHub Pages by disgruntledphd2 on Friday August 21, 2020 @04:55AM (#24233265)
Apologies, SQL for almost everything, and sed for the text files that didn't get updated.

It appeared to work a few times (or at least my wife/her customers didn't complain).

Re:I tried to use WordPress with GitHub Pages by manigandham on Sunday August 16, 2020 @08:19PM (#24182546)
Yes, that's what the last sentence is about.
Re:I tried to use WordPress with GitHub Pages by forgotmypw17 on Monday August 17, 2020 @09:44AM (#24187131)
>why do you need to host it locally?

offline editing?

Re:I tried to use WordPress with GitHub Pages by coldtea on Sunday August 16, 2020 @07:05PM (#24182150)
>Should 'blog writing' software really have such a greater barrier of entry?

It doesn't.

You can open an account on Wordpress.org and be writing your blog in 1 minute.

You can use your virtual hosting's manager to install Wordpress and be running in 10 minutes.

You can download MAMP or WAMP (packaged Wordpress + MySQL + Apache + PHP) and be running locally in 15 minutes.

This guy wanted to do an install locally manually, patch it to produce static pages (which is not what it was made for0, hook it up with GitHub pages, and so on. And all that without bothering to know how.

Re:I tried to use WordPress with GitHub Pages by frereubu on Sunday August 16, 2020 @08:00PM (#24182457)
Small nit just for clarity: you mean "open an account on wordpress.com" - wordpress.org is the self-hosted version.
Re:I tried to use WordPress with GitHub Pages by coldtea on Sunday August 16, 2020 @10:25PM (#24183284)
Yeah, .com
Re:I tried to use WordPress with GitHub Pages by todotask on Sunday August 16, 2020 @09:44PM (#24183045)
Open an account on WordPress.com, you need to account for unforeseen downtime which is probably hosted on GoDaddy.
Re:I tried to use WordPress with GitHub Pages by todotask on Friday August 21, 2020 @08:47PM (#24240575)
Don't understand the downvote, it's a fact that downtime does happen.
Re:I tried to use WordPress with GitHub Pages by jay_kyburz on Sunday August 16, 2020 @06:04PM (#24181750)
Re:I tried to use WordPress with GitHub Pages by kaslai on Sunday August 16, 2020 @05:38PM (#24181581)
This was pretty much my thoughts too. This use case is quite a bit outside of the realm of what Wordpress is intended to be used for. Local deployments are only really intended to be for people who are serious about administrating their own web server or developing plugins for Wordpress, so it's assumed that you already have the knowledge to set up a web server with PHP and MySQL.

The people who want a "writing first" experience _with Wordpress specifically_ have many paid hosting providers to choose from, but that would defeat the purpose of the article.

Making a one-click installation process would also take a significant amount of dev resources to handle all the different platforms and require expertise that isn't required for the main product, given that it is a PHP project which is almost entirely cross platform by default.

Re:I tried to use WordPress with GitHub Pages by noahtallen on Monday August 17, 2020 @12:10AM (#24183858)
For what it’s worth, many WordPress devs are using docker solutions anyways these days. For example, core WordPress and Gutenberg (the block editor) are often developed using Docker. You can do it other ways too, but much of the tooling is built around docker anyways.

In fact, myself and a few others have spent some time improving the local environment situation with a tool called wp-env [1]. So long as you have docker & node installed, you can install wp-env with npm. Then you can just use “wp-env start” to get a local WordPress instance running. It’s fairly straightforward to configure for basic needs too! No need to understand Apache, SQL, FTP, or even PHP to get it running.

All this to say: there are open source solutions to the local dev environment problem even being developed and supported by core WordPress teams. :)

1: https://make.wordpress.org/core/2020/03/03/wp-env-simple-loc...

Re:I tried to use WordPress with GitHub Pages by king_phil on Sunday August 16, 2020 @05:45PM (#24181629)
I run a shared hosting business. Mostly wordpress, of course. Most people have their first contact with all this when their site is hacked (plugins not updated for years) and they have to clean up. Then we need to babysit them - but to a degree that is what we are paid for. And for good reason.
Re:I tried to use WordPress with GitHub Pages by coldtea on Sunday August 16, 2020 @07:06PM (#24182154)
>Most people have their first contact with all this when their site is hacked (plugins not updated for years)

Well, Wordpress can know auto-update the plugins...

Re:I tried to use WordPress with GitHub Pages by reilly3000 on Monday August 17, 2020 @02:02AM (#24184420)
The problem is most Wordpress plugins are abandoned. Most sites default to auto updating plugins, but if the plugin author isn’t pushing security patches it’s a big vulnerability.

Wordpress plugins are notoriously bad at input sanitization. Even many large, commercially supported plugins get abandoned or simply aren’t secure.

Re:I tried to use WordPress with GitHub Pages by AnonHP on Sunday August 16, 2020 @11:29PM (#24183608)
> Well, Wordpress can know auto-update the plugins...(sic)

And your site (Or some parts of your site) could break at any point in time without your knowledge and remain broken for a long time until you find that it’s broken. There is no platform that doesn’t require “babysitting” with maintenance and testing.

Re:I tried to use WordPress with GitHub Pages by coldtea on Monday August 17, 2020 @05:44AM (#24185611)
The key is to use select few plugins, with huge communities, sure to be updated to the latest version...

You still need to check on them, sure.

>and remain broken for a long time until you find that it’s broken

Well, if you don't find out that it's broken fast enough, perhaps you don't need it anyway!

Re:I tried to use WordPress with GitHub Pages by todotask on Sunday August 16, 2020 @11:36PM (#24183641)
However, we have a site with visual builder that is no longer under annual subscription.
Re:I tried to use WordPress with GitHub Pages by blakesterz on Sunday August 16, 2020 @06:44PM (#24182011)
I can totally relate to this. Just shut down my little hosting business I've been doing since 2002. I just couldn't keep everyone safe.
Re:I tried to use WordPress with GitHub Pages by jonwinstanley on Sunday August 16, 2020 @05:35PM (#24181551)
Totally agree, running Wordpress locally needs a minimum understanding of Apache, MySQL and PHP for sure
Re:I tried to use WordPress with GitHub Pages by tmpz22 on Sunday August 16, 2020 @05:47PM (#24181643)
I'd add you need to know how your OS will handle the installation, IIRC Mac OS comes with pre-installed PHP and/or Apache which uses configuration files you might not know to look for and may conflict using the same ports etc. Its a mess.
Re:I tried to use WordPress with GitHub Pages by reaperducer on Sunday August 16, 2020 @06:21PM (#24181864)
It's not a mess. It's just different from what you're used to.

Running WordPress on macOS is slightly different from running WordPress on Ubuntu, which is different from running it on CentOS.

I maintain WordPress sites on all three. None of them are inferior to the other for this purpose. They just have different conventions.

In fact, I've had far fewer problems running multiple WordPress installations on macOS than I have on CentOS. But that's because I understand Apache better than the author of this article. Pretty much the only problem comes during a major OS upgrade when the installed backs up some of your configuration files and replaces them with the default. But once you deal with it one or two times, you know what to do.

Re:I tried to use WordPress with GitHub Pages by hbcondo714 on Sunday August 16, 2020 @07:50PM (#24182404)
For local WordPress development, we used Bitnami's WordPress image[1]. Later, we used Local by Flywheel[2]. Both used VirtualBox so it was nice to get the entire WordPress stack with minimal installations. We only had a .NET developer at the time but he was able to "pick up" the LAMP stack with these solutions.

[1] https://bitnami.com/stack/wordpress/virtual-machine

[2] https://localwp.com/

Re:I tried to use WordPress with GitHub Pages by httpsterio on Monday August 17, 2020 @04:57AM (#24185368)
What would you consider understanding the tech? I can't write a single line in Apache config nor can I do a Hello World in PHP or query anything in MySQL, but I can setup and install WordPress on a local machine or a server.

I don't feel like that I understand the underlying tech, but as long as you know how to install WordPress, you can install WordPress.

Re:I tried to use WordPress with GitHub Pages by wolco on Sunday August 16, 2020 @06:19PM (#24181856)
With programs like ammp abd wamp and others things are really point and click.
Re:I tried to use WordPress with GitHub Pages by mdu96 on Sunday August 16, 2020 @05:37PM (#24181566)
Yes, hence the caveat. :)

For my purposes (set up a simple blog and get it running), I truly don't think that I need, or should, have to learn the ins and outs of the tech stack. In fact I chose WordPress specifically _because_ I wanted it to abstract most of the implementation details away from me.

I don't think this is true for development generally.

Re:I tried to use WordPress with GitHub Pages by frereubu on Sunday August 16, 2020 @05:43PM (#24181615)
Perhaps it wasn't intended, but the post read as a complaint that it wasn't easy, but self-hosted WordPress (i.e. wordpress.org rather than wordpress.com) doesn't sell itself as a one-click install CMS. (Although there are things like MAMP that allow you to delegate the basic server setup).
Re:I tried to use WordPress with GitHub Pages by macspoofing on Sunday August 16, 2020 @07:56PM (#24182434)
>For my purposes (set up a simple blog and get it running), I truly don't think that I need, or should, have to learn the ins and outs of the tech stack.

Well ... if you want a simple blog, then you can setup an account with the 10million hosted blogging services that are out there. And if you want a wordpress blog, then you can set up an account with wordpress.com, or get a hosted solution with Wordpress/LAMP already preinstalled, or get a VM with Wordpress pre-configured (e.g. Vagrant Box with Wordpress: https://themeisle.com/blog/vagrant-wordpress/).

What you wanted however, was a locally hosted Wordpress (why?) that you installed and configured (on Windows no less). That's fine, but Wordpress requires PHP, and requires a web-server, and requires a database - so you'll have to be able to understand what all those pieces are in order to install and configure them together.

>In fact I chose WordPress specifically _because_ I wanted it to abstract most of the implementation details away from me.

Which it does. There is a difference between being a user of Wordpress and installing and administrating Wordpress. For the former, understanding the tech stack is not required. The UI is meant to be used by non-tech savvy people. For the latter, yeah, you need to be familiar with the tech stack. That you're not, and you had some trouble installing it, that's not the fault of Wordpress.

Re:I tried to use WordPress with GitHub Pages by searchableguy on Sunday August 16, 2020 @08:55PM (#24182747)
Re:I tried to use WordPress with GitHub Pages by nashadelic on Sunday August 16, 2020 @06:23PM (#24181879)
Yes but the promise of wordpress is to democratize content and its distribution. It works in many ways and fails in some.
Re:I tried to use WordPress with GitHub Pages by scotu on Sunday August 16, 2020 @06:06PM (#24181769)
while you are right for a tl;dr, from the article, the feeling I'm getting is more that those are known unknowns only now for the author, and they were unknown unknowns at the beginning.

The fact that each moving part wp needds is tricky in its own way doesn't make the experience better if you are encountering them for the first time :)

The author was probably not aware how complicated set of dependencies (moving parts) wordpress needs compared to jekyll. Which is fair if from the outside the two seem to be products in the same category.