Coder Social home page Coder Social logo

Comments (5)

leonstafford avatar leonstafford commented on May 28, 2024

in ArchiveProcessor.php:239:

$temp_zip = $archive_path . '.tmp';

we're not using WP's get_temp_dir(), so it tries to create in uploads dir

from static-html-output.

leonstafford avatar leonstafford commented on May 28, 2024

further looking, archive directory is empty. needs to fail much earlier

from static-html-output.

leonstafford avatar leonstafford commented on May 28, 2024

out of practice wth Docker.

issue was with container needing to access WP on same URL/port as defined in Site URL/Home, while allowing host to also access WP.

Using default WP docker image, this is easiest done by mapping port 80:80, as vhost within container already set to listen on 80.

If changing after WP installation has already occurred, can override URLs in wp-config.php:

define( 'WP_SITEURL', 'http://localhost');
define( 'WP_HOME', 'http://localhost');

or search-replace values in DB via WP-CLI.

With other images, can use custom vhost templates to proxy requests or have Apache listening on same port as host for same result.

Back to this original issue: crawling every detected URL was failing. This was logged in WP2Static's Export Log when Debug Mode was enabled, but allowed export to complete, attempting to zip an empty archive directory.

Export log logged as:

Crawling /wp-content/themes/twentytwenty/assets/images/2020-square-1.png
cURL error:Failed to connect to localhost port 8000: Connection refused
BAD RESPONSE STATUS (0): /wp-content/themes/twentytwenty/assets/images/2020-square-1.png 

Different than 404's which we want to log and continue the export, these cURL connection refused errors should throw an exception, preventing the crawling to keep attempting and failing on each URL and export process to attempt to continue with an empty archive dir.

Deployment step should also throw an exception when given an empty archive dir,

from static-html-output.

leonstafford avatar leonstafford commented on May 28, 2024

if putting into Docker quick start guide, also mention disabling default web service running on 80, in case of default Ubuntu installation, for example; provide own WP2Static image with php.ini and vhost custom templates to allow on non-standard ports for those wanting to elegantly run many sites on local machine

from static-html-output.

leonstafford avatar leonstafford commented on May 28, 2024

wip optimized environment https://lokl.dev

from static-html-output.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.