Failed to generate plugin
mkerbouche opened this issue · 14 comments
Hi!
When a I try to generate plugin following the tuto I have this issue :
$ ./wpmvc generate myplugin
./core/
Parse error: syntax error, unexpected T_STRING in ****/wp-includes/l
oad.php on line 1095
I'm on Wordpress 4.9.4 and I've tried with php 5.4 and php 7.1
Thanks !
Hi--this doesn't look related to the plugin. Line 1095 is:
return ( $thing instanceof WP_Error );
But it seems like there is a parse error there in your installation (i.e. that line says something else that isn't valid PHP). You may want to reinstall WordPress, disable other plugins, and debug from there.
The wordpress installation is new, it's a clean install there is no plugin...
Looks like the correct syntax is: ./wpmvc generate plugin MyPlugin
. If that doesn't work, is this a multisite installation?
It's the same :
$ ./wpmvc generate plugin myplugin
Parse error: syntax error, unexpected T_STRING in /homepages/12/d563432393/htdocs/bf/wp-includes/l
oad.php on line 1095
Thanks.
Can anyone else watching this thread reproduce this? So far no luck for me...
Also what is the text on /homepages/12/d563432393/htdocs/bf/wp-includes/load.php
line 1095?
it is : return ( $thing instanceof WP_Error );
Unfortunately on a clean installation of WordPress (single site) with just the wp-mvc plugin, I cannot reproduce this:
$ ./wpmvc generate plugin myplugin MyPlugin
Welcome to WP MVC Console!
[Running Generate::plugin]
[Complete]
$ ls ..
akismet hello.php index.php myplugin wp-mvc
This is running PHP 7.0.27 (cli) (built: Jan 5 2018 12:26:39) ( NTS )
WordPress 4.9.4 and WP MVC 1.3.14 (latest) from the plugin repository.
Silly question: have you activated the plugin on the install already?
Yes it is activated.
I've tried on several installations of WP but it always failed
I've found the issue :
I am hosted by 1and1 and they provide an old version of php when using command line.
I had to specify the version of php when using the command line
Great, glad you found it!
In case anyone else finds this thread in future, could you specify which version of php was the culprit? Sounds like it wasn't able to parse the instanceof
command? Or something else?
Thanks for coming back to clarify.