dimanche 28 juillet 2019

Configuring CUPS for dev with laravel

So, I have a good knowledge with Laravel but not so much on terminal/file permissions/access. I am working on creating my own printserver and I came across with cups. I am using mac and this is preinstalled.

I have added smalot/cups-ipp in the composer.json. In the docs, it says this as a requirement:

Requirements This library use unix sock connection: unix:///var/run/cups/cups.sock

First of all, check if you have correct access to this file: /var/run/cups/cups.sock

I don't know what I am supposed to do with that or how to check. Created CupsController and pasted the code from their implementation usage guide but got this error:

No such file or directory

I think this is something to do with not meeting the requirements.

UPDATE: Seems I can't create a socket..

protected function createSocket(RequestInterface $request, $remote, $useSsl)
{
    $errNo = null;
    $errMsg = null;
    $socket = @stream_socket_client($remote, $errNo, $errMsg, floor($this->config['timeout'] / 1000), STREAM_CLIENT_CONNECT, $this->config['stream_context']);

    if (false === $socket) { // THIS THROWS. CAN'T CREATE SOCKET
        throw new ConnectionException($errMsg, $request); 
    }

    stream_set_timeout($socket, floor($this->config['timeout'] / 1000), $this->config['timeout'] % 1000);

    if ($useSsl && false === @stream_socket_enable_crypto($socket, true, $this->config['ssl_method'])) {
        throw new SSLConnectionException(sprintf('Cannot enable tls: %s', error_get_last()['message']), $request);
    }

    return $socket;
}



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2MnHfGO
via IFTTT

Aucun commentaire:

Enregistrer un commentaire