picocms / Pico

Pico is a stupidly simple, blazing fast, flat file CMS.
http://picocms.org/
MIT License
3.83k stars 617 forks source link

New Pico 2.0 beta2 installation gives HTTP Error 500 #418

Closed sonst-was closed 6 years ago

sonst-was commented 6 years ago

Hi everyone,

I was eager to try the new version of Pico and downloaded the latest version (beta2). After downloading the pre-release and uploading everything to my webspace I was asked to use composer install first. So I let composer do its thing and after a while it was done giving only the following warnings:

Package kherge/version is abandoned, you should avoid using it. No replacement was suggested. Package herrera-io/json is abandoned, you should avoid using it. Use kherge/json instead. Package herrera-io/phar-update is abandoned, you should avoid using it. No replacement was suggested.

I thought I'd be good and tried to access my new Pico installation but I only got a HTTP Error code 500. The PHP error log goes a bit more into details:

[Thu Feb 15 14:44:25.636277 2018] [proxy_fcgi:error] [pid 11855:tid 140344926480128] [client 62.143.162.45:55314] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught RuntimeException: Plugins using an older API than version 2 found, but PicoDeprecated isn't loaded in /home/something/html/something.de/pico2/lib/Pico.php:522\nStack trace:\n#0 /home/something/html/something.de/pico2/lib/Pico.php(401): Pico->loadPlugins()\n#1 /home/something/html/somethings.de/pico2/index.php(36): Pico->run()\n#2 {main}\n thrown in /home/something/html/something.de/pico2/lib/Pico.php on line 522\n'

It looks like the PicoDeprecated plugin isn't loaded - and indeed it isn't in the plugins directory. So while writing this issue I just downloaded the plugin and uploaded it. I still get a HTTP Error code 500 but this time with a different error in the error log:

[Thu Feb 15 14:54:04.651587 2018] [proxy_fcgi:error] [pid 11801:tid 140345245402880] [client 62.143.162.45:55456] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Twig_Error_Loader: The "/home/something/html/something/pico2/themes/default" directory does not exist ("/home/something/html/something/pico2/themes/default"). in /home/something/html/something/pico2/vendor/twig/twig/lib/Twig/Loader/Filesystem.php:101\nStack trace:\n#0 /home/something/html/something/pico2/vendor/twig/twig/lib/Twig/Loader/Filesystem.php(82): Twig_Loader_Filesystem->addPath('/home/something...', 'main')\n#1 /home/something/html/something/pico2/vendor/twig/twig/lib/Twig/Loader/Filesystem.php(40): Twig_Loader_Filesystem->setPaths(Array)\n#2 /home/something/html/something/pico2/lib/Pico.php(1936): Twig_Loader_Filesystem->construct('/home/something...')\n#3 /home/something/html/something/pico2/lib/AbstractPicoPlugin.php(199): Pico->getTwig()\n#4 /home/something/html/something/pico2/plugins/PicoDeprecated/PicoDeprecated.php(645): AbstractPicoPlugin->call('getTwig', Array)\n#5 /home/something/html/something/pico2/lib/AbstractPicoP...\n' [Thu Feb 15 14:54:06.650543 2018] [proxy_fcgi:error] [pid 11855:tid 140345094334208] [client 62.143.162.45:55522] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Twig_Error_Loader: The "/home/something/html/something/pico2/themes/default" directory does not exist ("/home/something/html/something/pico2/themes/default"). in /home/something/html/something/pico2/vendor/twig/twig/lib/Twig/Loader/Filesystem.php:101\nStack trace:\n#0 /home/something/html/something/pico2/vendor/twig/twig/lib/Twig/Loader/Filesystem.php(82): Twig_Loader_Filesystem->addPath('/home/something...', 'main')\n#1 /home/something/html/something/pico2/vendor/twig/twig/lib/Twig/Loader/Filesystem.php(40): Twig_Loader_Filesystem->setPaths(Array)\n#2 /home/something/html/something/pico2/lib/Pico.php(1936): Twig_Loader_Filesystem->construct('/home/something...')\n#3 /home/something/html/something/pico2/lib/AbstractPicoPlugin.php(199): Pico->getTwig()\n#4 /home/something/html/something/pico2/plugins/PicoDeprecated/PicoDeprecated.php(645): AbstractPicoPlugin->call('getTwig', Array)\n#5 /home/something/html/something/pico2/lib/AbstractPicoP...\n'

So apparently there is no default theme, which kinda explains why Pico is unable to display anything. After uploading the default theme it works now.

So... after I solved my issues by myself while writing this issue the only question I have left is: Shoudn't the PicoDeprecated plugin and the default theme included in the Pico installation by default? (I can see both issues not being applicable with the current code, but they are with the beta2 pre-release package)

Kind regards sonst-was

PhrozenByte commented 6 years ago

You basically applied the installation instructions for Pico 1.0 to Pico 2.0. This still works, but has the effects you described above. Starting with Pico 2.0 the main picocms/Pico repository is no longer the "frame" of Pico installations, but rather a dependency of a new separate "frame project" (picocms/pico-composer). It's picocms/pico-composer that installs both the PicoDeprecated plugin and Pico's default theme, picocms/Pico just suggests installing them.

See the "Install" section of Pico 2.0's README.md. If you've read the README.md before and remember that it looked completely different in beta 2, then you're absolutely right. We've updated the installation instructions just recently and after the release of beta 2, so you couldn't know this (i.e. you didn't make anything wrong). Nevertheless I highly recommend re-installing Pico using one of the new official Pico 2.0 installation methods. For a composer-based installation use the following:

composer create-project picocms/pico-composer .

The Package … is abandoned messages are caused by development dependencies of Pico when installing Pico with development dependencies (what is the default when using composer install). These packages aren't necessary in a productive environment (try composer install --no-dev). Anyway, the messages don't cause any harm, they can be ignored.

sonst-was commented 6 years ago

You basically applied the installation instructions for Pico 1.0 to Pico 2.0.

Well... damn :(

Nevertheless I highly recommend re-installing Pico using one of the new official Pico 2.0 installation methods. For a composer-based installation use the following:

Actually I didn't planned to use the composer-based installation method, it was suggested to me by Pico itself ;) My webhoster changed their system recently and before I was unable to use composer so I just uploaded it and thought it was good (as I did with 1.x). I planned to do the same now with beta2 but then it said it wants composer. But I'll try to reinstall Pico as soon as I'm home (my tablet lost its WiFi connection so I'm unable to do this from work using Guacamole :P).

PhrozenByte commented 6 years ago

You can simply use one of our pre-bundled releases (it's the pico-release-v2.0.0-beta.2.tar.gz from https://github.com/picocms/Pico/releases/tag/v2.0.0-beta.2, not Source code), upload all files to your webserver and you're ready to go 😄

sonst-was commented 6 years ago

I just did that and everythings working.

Thanks again for your help!