typemill / typemill

Typemill is a lightweight, flat-file CMS designed for simple, fast, and flexible website and eBook creation using Markdown.
https://typemill.net
MIT License
427 stars 60 forks source link

PHP 8 required after composer update #293

Closed gingerbeardman closed 2 years ago

gingerbeardman commented 2 years ago

Hi,

I just installed as directed:

  1. git clone git://github.com/trendschau/typemill.git
  2. composer update
  3. make certain folders writable

Afterwards, I got this error:

Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.2".

I cannot force my host to be PHP 8, so is there any way to get requirements back down to PHP 7 (as in the typemill readme). I don't know how to figure out which package has forced composer/PHP to go so high.

Thanks!

trendschau commented 2 years ago

Hi and thank you!

I am not aware of PHP 8.0.2 requirement, version 1.5.1 should run with PHP 7.4 (my servers run with 7.4, too). I will test the github version again in the next days, in the meantime you could use the zipped version from the typemill website that I use for my sites.

gingerbeardman commented 2 years ago

Thanks! I will decide what to do when I've finished developing the site locally with MAMP/PHP8.

trendschau commented 2 years ago

I tested it today with:

git clone git://github.com/trendschau/typemill.git
composer update

On my xampp/windows machine with php 7.4 installed and it works without problems. I also checked requirements with composer

C:\xampp\htdocs\typemill>composer check-platform-reqs
Checking platform requirements for packages in the vendor dir
ext-dom        20031129    success
ext-gd         7.4.15      success
ext-json       7.4.15      success
ext-libxml     7.4.15      success
ext-mbstring   7.4.15      success
ext-simplexml  7.4.15      success
php            7.4.15      success

On my linux it also runs without problems.

I am not sure why your version requires PHP8. Do you have the chance to test it on another computer/server?

gingerbeardman commented 2 years ago

I get the below. With or without composer update step.

I'm on macOS if that makes any difference.

I don't have another system to check it on, sorry.

$ git clone git://github.com/trendschau/typemill.git
composer update
Cloning into 'typemill'...
remote: Enumerating objects: 8116, done.
remote: Counting objects: 100% (1330/1330), done.
remote: Compressing objects: 100% (815/815), done.
remote: Total 8116 (delta 899), reused 853 (delta 474), pack-reused 6786
Receiving objects: 100% (8116/8116), 15.47 MiB | 5.18 MiB/s, done.
Resolving deltas: 100% (4678/4678), done.
$ cd typemill
$ composer update
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 2 updates, 1 removal
  - Removing symfony/polyfill-php80 (v1.23.1)
  - Upgrading symfony/finder (v5.3.7 => v6.0.0)
  - Upgrading twig/twig (v1.44.5 => v1.44.6)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 22 installs, 0 updates, 0 removals
  - Installing psr/http-message (1.0.1): Extracting archive
  - Installing akrabat/proxy-detection-middleware (0.4): Extracting archive
  - Installing erusev/parsedown (1.8.0-beta-7): Extracting archive
  - Installing erusev/parsedown-extra (dev-master fd33d68): Extracting archive
  - Installing symfony/finder (v6.0.0): Extracting archive
  - Installing gregwar/captcha (v1.1.9): Extracting archive
  - Installing jbroadway/urlify (1.1.3-stable): Extracting archive
  - Installing laminas/laminas-zendframework-bridge (1.4.0): Extracting archive
  - Installing laminas/laminas-permissions-acl (2.8.0): Extracting archive
  - Installing paragonie/random_compat (v9.99.100): Extracting archive
  - Installing slim/csrf (0.8.3): Extracting archive
  - Installing slim/flash (0.4.0): Extracting archive
  - Installing psr/container (1.1.2): Extracting archive
  - Installing pimple/pimple (v3.5.0): Extracting archive
  - Installing nikic/fast-route (v1.3.0): Extracting archive
  - Installing slim/slim (3.12.3): Extracting archive
  - Installing symfony/polyfill-ctype (v1.23.0): Extracting archive
  - Installing twig/twig (v1.44.6): Extracting archive
  - Installing slim/twig-view (2.5.1): Extracting archive
  - Installing symfony/event-dispatcher (v3.4.47): Extracting archive
  - Installing symfony/yaml (v2.8.52): Extracting archive
  - Installing vlucas/valitron (dev-master 5ebd5d7): Extracting archive
Generating autoload files
7 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
$ composer check-platform-reqs
Checking platform requirements for packages in the vendor dir
ext-dom        20031129    success  
ext-gd         8.0.13      success  
ext-json       8.0.13      success  
ext-libxml     8.0.13      success  
ext-mbstring   8.0.13      success  
ext-simplexml  8.0.13      success  
php            8.0.13      success  
trendschau commented 2 years ago

I suppose that means you are running on php 8.0.13 and that is enough for dependency-requirements.

I checked all my live websites with 7.4 and 8 and they run without problems, live and locally.

checked most of the dependencies manually and none require php8

So it is very likely a problem with your local setup and I can't help here. Maybe this thread can help: https://laracasts.com/discuss/channels/laravel/unable-to-run-composer-update-or-composer-install-command

So you can try to update composer and clear cache

composer clearcache 
composer selfupdate
gingerbeardman commented 2 years ago

OK, I solved it.

I am running MAMP with PHP 7.4.21 Screenshot

But my macOS default /usr/local/bin/php is PHP 8.0.13 (I guess installed from homebrew at some point?) and this is what composer sees from the command line.

I looked into it and /usr/bin/php is still PHP 7.3.29.

So if I do /usr/bin/php /usr/local/bin/composer update then that will set everything as required for running with PHP 7.

Then the typemill installation loads without complaint on MAMP.

Hurrah!