PHP Fatal error: Cannot use 'String' as class name as it is reserved in phar: when using php 7 #297
Comments
Same here, the error seems to come from justinrainbow/json-schema. |
@evert @gnugat @stevleibelt Can any of you do a |
Would you mind providing a .phar? I don't have multiple PHP's running and self-update breaks before it can update itself. |
@evert sure!
There is a link here, too: https://sculpin.io/download/ |
Works! awesome. builds site immediately |
Awesome. I'm closing this until we find the next PHP 7 issue. :) |
Thank you for looking into this, it's fixed now. |
Hey, I'm very sorry but I made a mistake. I think I just tested this on the computer I was on at the time, which had PHP 5.6. Trying this again on my laptop (this time with PHP7 for real) still throws this error. What change did you make @simensen to support this? Is it using the correct version of json-schema now? |
@evert Did you get a brand new version of the phar via direct download? What version does it say when you run the version command? If you can provide the full error output that would be helpful, too, so I can try and track this down better. |
Alright I also understand a bit better what went wrong earlier. If I run sculpin in a random directory, sculpin runs and I get:
This is what must have tripped me over. When I |
@evert huh. so you still get the string error message when you are in your website directory? are you installing sculpin locally in that directory via composer.json instead of using the phar? i'm pretty confused about what is actually going on and i'm not sure if you're saying you still have a problem or not. |
So... yes I do still get the error. Steps to reproduce:
I'm not installing sculpin via composer manually, just using the phar. Links: |
Can you share the error as well? The one you get showing the broken class? |
|
Alright, something is wrong w/ my build script. :( I'm on it. |
@evert Sigh. There seems to be something very weird w/ box (or how I'm using it) because All that said, as a temporary workaround, you could clone sculpin locally and composer install and use that version for the time being. I think that should work for you. |
By that, I mean that PHP 7 should be fully supported by what is in the repository now. I need to fix this build pipeline soon, though, so hopefully it will only be a temporary workaround. |
alright thanks, good to know! at least I'll have a workaround |
I confirm that this workaround works (I used it while waiting for the fix, but forgot to mention it here, sorry about that). |
Am still facing some related issue here . Recentily I have downloaded the a skeleton and tried to install it as bellow.
What I am doing wrong. |
@vrkansagara so far, nothing beside switching back to php 5.6.* |
@stevleibelt Thanks. |
@vrkansagara & @stevleibelt: Or as mentioned by @simensen use this work around for PHP 7:
|
@gnugat |
Nope, I'm talking about installing a PHP 7 compatible sculpin. The error you get is caused by a dependency of sculpin that isn't compatible with PHP 7 (it has a class named String, and string has become a language keyword in PHP 7). It is only encountered when using the installer. If you install sculpin using the instructions I've given you won't have the issue. Give it a try. |
@gnugat Am taking about running a server with |
I have the same problem. When I try to run Sculpin install I get the message.
I am using the latest version and yet...
I am running php 7. |
I'm still having the same problem. I followed the instructions as described by @gnugat except instead of copying the executable, I created a symlink, like so:
|
The phar downloads still contains |
That would be so great! Sculpin is starting to look bad! |
|
I spent some time tonight looking at the sad state that is the Sculpin build process. There are several places that things have fallen down. Not the least of which is that my automated subtree repository splits are broken. The infrastructure there was so hacky I don't even know where to begin to fix it. It would take more time and energy to fix it than I have to put into it at this point. This means that for all intents and purposes, the subtree splits for Sculpin components and Embedded Composer components are stuck where they are now. Sucks, but I'm not sure I have any other options. I'm going to look into abandoning the components and just suggest people install the main package if they are going to. You can see the work I have been able to do in #311. There was a PR against embedded composer that will hopefully make the themes plugin work again. I've also changed the dependencies across the board to support Composer stable ^1.0. These things together will hopefully allow successful installs from git again. If you were previously using |
hm. well using composer for dependencies and using sculpin just for building the site makes as much sense, and maybe even more sense to me than the current model ;) I never fully understood why sculpin also had to do what composer is doing. But right now I'm using a globally installed sculpin. So is full upgrade path then:
And then I should be able to just call Or am I missing something? |
@evert yes, that should be close. most likely:
as for doing why sculpin was doing what composer does is because sculpin initially started out as a proof of concept for the whole idea of embedding composer into an application to manage application-specific plugins. i wanted an app that shipped as a phar that managed all of its own dependencies and allowed you to extend it by installation plugins with the phar itself. the idea was only somewhat popular (i only know a handful of applications that have tried it) and people have just grown accustomed to having composer install all the things in all cases anyway so it has become less interesting for me to pursue that idea over time. i'm more liking the idea of the project owning all of its dependencies and not relying on global installs for things these days so this change works with that ok. i've seen no objections to this pr. i'll likely merge it tonight unless someone has an issue with it i haven't thought about yet. hopefully then tomorrow we can try to build with the code merged and see if master starts working w/ the workflow listed here to migrate from sculpin.json to composer.json. |
Getting closer but I'll have to look at it more tonight. Looks like I need to update the theme package to support composer-plugin-api
|
Exciting! Thanks for picking this back up @simensen . I imagine not embedding composer might also reduce the footprint of sculpin quite a bit, making it easier to maintain. |
After tagging the plugin I was able to get this migration path to work just fine. I was also able to do some simple benchmark stuff to see the speed difference that PHP 7 makes for the first time. :) Good times. @evert Can you try the migration on your site to see if it works? Thanks! |
Both beau.io and sculpin.io are now built using this migration path and my deploy scripts on forge have been updated accordingly. Everything looks good.... so far. |
Still getting an issue with this:
|
Some news: it worked now. the difference? I'm installing on PHP 7. I've always been going back and forward between PHP 5 and 7, and I only got that dependency problem when trying it on PHP 5. Works on 7 though! |
I'm still experiencing this, has anyone reached any progress? I'm using the beta macOS (OSX 10.12) and PHP 7 installed with brew. Except for Sculpin, everything else is working. Unfortunately this forced me into not updating my site in a few months, and I'll probably have to investigate other options. |
@georgiana-gligor Hi! I apologize for the problems you have been experiencing. Are you trying to use the phar? Or are you using composer installed version for your site? Is your repo public? :) |
Hey @simensen , thanks for the quick reply! ➤ php -v
PHP 7.0.8 (cli) (built: Jun 23 2016 16:32:40) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans I grabbed the phar and moved it with |
@georgiana-gligor Yeah, OK, I need to get this blogged about. :( The phar distribution stuff is broken and stuck at an older version of Sculpin. That version of Sculpin doesn't support PHP 7 and I don't think there will ever be a phar that supports PHP 7. Let me see if I can get your site building under PHP 7 sometime today using composer installed Scupin instead of the phar. But first I should ask, would you consider trying that? :) |
Would be happy to help you with this, I would prefer not to switch to another system. It took me a month to decide on it anyway... The thing that got me started specifically today was that I wanted to add a blogpost about how I went to a tech conference and give the organizers a link to promote, but I guess I can wait until tomorrow. I just I don't add a lot on your plate in a short amount of time. Let me know if I can help. Will be offline for 3 hrs, and then back on. |
I'll add my solution here, in case someone else needs it. Thanks @simensen for helping me find it! A few months ago I moved
as dependencies in the My mistake was that I kept on running the The correct way to call it for me was to use |
I'm going to close this issue now. I've finally blogged about Deprecating Phar Distribution and Embedded Composer. If we still have issues w/ PHP 5.x please open a new issue for that. I'm guessing that we should bite the bullet and upgrade all of our Symfony stack to fix those issues. Thanks for all your patience. :) |
Please update the "get started" https://sculpin.io/getstarted/ |
hum!! |
Hey there,
I get the following error when switching to php 7.
Kind regards,
stev
The text was updated successfully, but these errors were encountered: