Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue installing the example plugin #157

Open
omerfarooX opened this issue Oct 10, 2016 · 15 comments
Open

Issue installing the example plugin #157

omerfarooX opened this issue Oct 10, 2016 · 15 comments
Labels

Comments

@omerfarooX
Copy link

Hey,
I am having some issues installing the example plugin. So here is the steps i follow.

Step 1: while inside wp-content/plugins
git clone https://github.com/getherbert/example-plugin.git

Step 2: cd into the new directory then i do composer install, which downloads all the packages.

Then i try to activate the plugin, but i still cant activate the plugin from the plugin page. Is there something i am doing wrong??

@ken-bem
Copy link

ken-bem commented Oct 10, 2016

Can you please provide the error that you receive?

@omerfarooX
Copy link
Author

@ken-bem here is the error i am recieving.

Parse error: syntax error, unexpected '.' in C:\path\to\project\wp-content\plugins\example-plugin\vendor\illuminate\database\Capsule\Manager.php on line 199

@ken-bem
Copy link

ken-bem commented Oct 10, 2016

You may need to check if there is any incompatibility with other plugins you have installed, I had an issue with Herbert + Gravity Forms + WP Rest. Needed to put GF in non conflict mode.

@omerfarooX
Copy link
Author

Actually i was just testing it out, so i tried installing it on a completely fresh copy of wordpress without any plugin or themes.

@jasonagnew
Copy link
Member

@omer414 I think you've forgot to run composer

This is an example plugin for Herbert. Remember to run composer install

@omerfarooX
Copy link
Author

@jasonagnew thankyou jasonagnew for the quick response. Well this is my first time using herbert, but i have a bit of experience with laravel and composer.
Can you please confirm that we just need to

  1. place this plugin inside wp-content/plugins (like we do with other manual plugin installations)
  2. Then "composer install" while being in this plugin's directory

Thats it, right?

@jasonagnew
Copy link
Member

Not a problem

  1. Download the example - lets keep it simple and use the Zip: https://github.com/getherbert/example-plugin/archive/master.zip

  2. Unzip it will get folder called example-plugin-master we might aswell name it correctly to example-plugin

  3. Now you’ll need composer on your machine (https://getcomposer.org/)

  4. Go into your folder and run composer for example

cd ~/Downloads/example-plugin
composer install
  1. You’ll see a new folder is added call vendor

  2. You could copy it to your plugins folder or use Symbolic links mentioned in the Getting Started section: http://getherbert.com/

@omerfarooX
Copy link
Author

omerfarooX commented Oct 10, 2016

@jasonagnew ok this is exactly what i have been doing, but still getting the same error. On the last step instead of symbolic link i am just pasting it in the plugins directory.

Here is the error i am recieving on plugin activation

Plugin could not be activated because it triggered a fatal error: Parse error: syntax error, unexpected '.' in C:\lamp\www\project-name\wp-content\plugins\example-plugin\vendor\illuminate\database\Capsule\Manager.php on line 199

Have you tried it on the latest wordpress version?
Or is the because of old version of composer. My composer is around 6 months old, do you think it might be an issue?

@jasonagnew
Copy link
Member

Naw its not that. It's pulling in code that requires php 5.6. You could open the composer.json in the the example-plugin and change it to:

{
  "name": "getherbert/herbert-plugin",
  "description": "Herbert plugin",
  "license": "MIT",
  "require": {
    "getherbert/framework": "~0.9",
    "illuminate/http": "5.1"
  },
  "config": {
    "preferred-install": "dist"
  },
  "minimum-stability": "dev",
  "autoload": {
    "psr-4": {
      "ApiPosts\\": "app/"
    }
  }
}

Then run composer again.

@onigetoc
Copy link

onigetoc commented Nov 7, 2016

This is becoming boring the composer stuff.
There's no way to use it on a shared server.

@ken-bem
Copy link

ken-bem commented Nov 7, 2016

@onigetoc what do you mean?

@onigetoc
Copy link

onigetoc commented Nov 7, 2016

@ken-bem You can't use composer or command line on a shared server.
And why just no include all files in a project and it's done

@ken-bem
Copy link

ken-bem commented Nov 7, 2016

Well, true, but you can overcome this by setting your IDE that every time you save it uploads the changes to the hosting via FTP. I use Intellij and my PHP files are transferred as soon as i save.

@onigetoc
Copy link

onigetoc commented Nov 7, 2016

Hi @ken-bem
Ok thank you
Should you have to run php on your computer? because is never work well, it's always crashing

@ken-bem
Copy link

ken-bem commented Nov 7, 2016

No i rarely run it on my computer, i have a partition on a shared hosting server where i put all my plugins and i test them on the live site, also helps prevent the usual works on my machine but not on the live page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants