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

Undefined constant "Socket\Raw\AF_INET" #33

Open
nadir1122 opened this issue Jul 22, 2021 · 5 comments
Open

Undefined constant "Socket\Raw\AF_INET" #33

nadir1122 opened this issue Jul 22, 2021 · 5 comments

Comments

@nadir1122
Copy link

I am getting this error
Undefined constant "Socket\Raw\AF_INET"
in file
\vendor\clue\socket-raw\src\Factory.php:78

Code

$host = "aspmx.l.google.com";
    $port = 25;

    $client = Graze\TelnetClient\TelnetClient::factory();
    $dsn = $host.":".$port;
    $client->connect($dsn);
@biggianteye
Copy link
Contributor

The AF_INET constant is provided by the sockets extension. Does your PHP have this available? What does php -m show?

@nadir1122
Copy link
Author

image

Result of php -m
Sockets extension is enabled and other requirements are verified by composer.

@biggianteye
Copy link
Contributor

What do you get when you run php -r 'echo AF_INET;'

Also, how are you running the code from the first post?

@nadir1122
Copy link
Author

PHP Parse error:  syntax error, unexpected string content "echo", expecting end of file in Command line code on line 1

Parse error: syntax error, unexpected string content "echo", expecting end of file in Command line code on line 1

Code from the first post is being run through php artisan serve command. In Routes/web.php file.

@nadir1122
Copy link
Author

image

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

2 participants