phpWhois installation problem

Published 2 months ago by czaker

Hi guys,

I am pretty new with Laravel so please be patient with me :)

I want to use https://github.com/phpWhois/phpWhois with my project and I have problems with install process.

I've added "phpwhois/phpwhois": "~4.0" to my composer.json and I don't know what next, probably add something to providers in app.php? but how can I figure out what should I add there?

If you could just point me in the right direction I would be great.

Thanks, Czaker

zachleigh

Did you actually install it with composer or just add it to the file?

czaker

@zachleigh Yes I used "composer update" after adding it to json and I have it in vendor folder.

zachleigh

So you can use the class in your project then.

use phpWhois\Whois;

$whois = new Whois();
$query = 'example.com';
$result = $whois->lookup($query,false);
echo "<pre>";
print_r($result);
echo "</pre>";
czaker

@zachleigh I wish but there is an error: "(1/1) FatalErrorException Class 'phpWhois\Whois' not found"

I found this but it is not working either: https://github.com/phpWhois/phpWhois/issues/32

This error is on the line where I call "$whois = new Whois();"

Any ideas?

zachleigh

Couldnt get it to work here either. I think that package is dead. Maybe try this one: https://github.com/regru/php-whois

czaker

When I try to add it to composer I get this:

Your requirements could not be resolved to an installable set of packages.

Problem 1
    - The requested package phois/whois ~1.0 exists as phois/whois[dev-master] but these are rejected by your constraint.

I tried by adding "phois/whois": "~1.0" to require in my composer.json

@zachleigh Thanks for help!

Sign In or create a forum account to participate in this discussion.