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

How to include the library in code #554

Closed
ghost opened this issue Dec 20, 2018 · 4 comments
Closed

How to include the library in code #554

ghost opened this issue Dec 20, 2018 · 4 comments

Comments

@ghost
Copy link

ghost commented Dec 20, 2018

I have installed the library with composer, when i run my code, i'm getting error - "Fatal error: Class 'JsonSchema\Validator' not found in".

How to include the library in my php file.
My file location is - /var/www/html/
json-schema library - /var/www/html/jsonvalidator

@shmax
Copy link
Collaborator

shmax commented Dec 20, 2018

Questions:

  1. Did you install via composer.json?
  2. If yes, do you see the library in your vendors folder?
  3. What does your code look like?
  4. What does the "include_path" property look like when you run phpinfo()?

@ghost
Copy link
Author

ghost commented Dec 20, 2018

  1. i installed it as - composer require justinrainbow/json-schema
  2. yes i can see the library in vendors folder
  3. my code is just an empty php file, where im testing this library before using in actual code.
  4. include_path => .:/usr/share/pear => .:/usr/share/pear

@shmax
Copy link
Collaborator

shmax commented Dec 20, 2018

Really need to see your code. Did you remember to require the autoloader? Something like:

require_once 'vendor/autoload.php';

@DannyvdSluijs
Copy link
Collaborator

@erayd here is another issue that can be closed as the report is now from a ghost user (deleted profile).

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

No branches or pull requests

3 participants