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

Cant install SSH2 #2298

Closed
diorgesl opened this issue Sep 25, 2019 · 2 comments
Closed

Cant install SSH2 #2298

diorgesl opened this issue Sep 25, 2019 · 2 comments

Comments

@diorgesl
Copy link

diorgesl commented Sep 25, 2019

Info:

  • Docker version ($ docker --version): Docker version 19.03.2
  • Laradock commit ($ git rev-parse HEAD): 861ea6b
  • System info (Mac, PC, Linux): Linux
  • System info disto/version: Ubuntu 18.04.3 LTS
  • Latest Laradock.

.env

PHP_FPM_INSTALL_SSH2=true

command:

sudo docker-compose build --no-cache nginx mysql phpmyadmin php-fpm

output:

/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c: In function 'php_ssh2_fopen_wraper_parse_path':
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:236:22: warning: passing argument 1 of 'strncmp' from incompatible pointer type [-Wincompatible-pointer-types]
if (strncmp(resource->scheme, "ssh2.", sizeof("ssh2.") - 1)) {
~~~~~~~~^~~~~~~~
In file included from /usr/local/include/php/main/../main/php_config.h:2616,
from /usr/local/include/php/Zend/zend_config.h:1,
from /usr/local/include/php/Zend/zend_portability.h:43,
from /usr/local/include/php/Zend/zend_types.h:25,
from /usr/local/include/php/Zend/zend.h:27,
from /usr/local/include/php/main/php.h:33,
from /tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:25:
/usr/include/string.h:139:33: note: expected 'const char *' but argument is of type 'zend_string *' {aka 'struct _zend_string *'}
extern int strncmp (const char *__s1, const char *__s2, size_t __n)
~~~~~~~~~~~~^~~~
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:242:48: warning: passing argument 1 of 'strcmp' from incompatible pointer type [-Wincompatible-pointer-types]
if (strcmp(resource->scheme + sizeof("ssh2.") - 1, type)) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/local/include/php/main/../main/php_config.h:2616,
from /usr/local/include/php/Zend/zend_config.h:1,
from /usr/local/include/php/Zend/zend_portability.h:43,
from /usr/local/include/php/Zend/zend_types.h:25,
from /usr/local/include/php/Zend/zend.h:27,
from /usr/local/include/php/main/php.h:33,
from /tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:25:
/usr/include/string.h:136:32: note: expected 'const char *' but argument is of type 'zend_string *' {aka 'struct _zend_string *'}
extern int strcmp (const char *__s1, const char *__s2)
~~~~~~~~~~~~^~~~
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:256:4: warning: assignment to 'char *' from incompatible pointer type 'zend_string *' {aka 'struct _zend_string *'} [-Wincompatible-pointer-types]
s = resource->path;
^
In file included from /usr/local/include/php/Zend/zend.h:29,
from /usr/local/include/php/main/php.h:33,
from /tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:25:
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:257:48: warning: passing argument 2 of 'strstr' from incompatible pointer type [-Wincompatible-pointer-types]
resource->path = estrdup(strstr(path, resource->path));
~~~~~~~~^~~~~~
/usr/local/include/php/Zend/zend_alloc.h:170:36: note: in definition of macro 'estrdup'
#define estrdup(s) _estrdup((s) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
^
In file included from /usr/local/include/php/main/../main/php_config.h:2616,
from /usr/local/include/php/Zend/zend_config.h:1,
from /usr/local/include/php/Zend/zend_portability.h:43,
from /usr/local/include/php/Zend/zend_types.h:25,
from /usr/local/include/php/Zend/zend.h:27,
from /usr/local/include/php/main/php.h:33,
from /tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:25:
/usr/include/string.h:329:14: note: expected 'const char *' but argument is of type 'zend_string *' {aka 'struct _zend_string *'}
extern char *strstr (const char *__haystack, const char *__needle)
^~~~~~
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:257:17: warning: assignment to 'zend_string *' {aka 'struct _zend_string *'} from incompatible pointer type 'char *' [-Wincompatible-pointer-types]
resource->path = estrdup(strstr(path, resource->path));
^
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:261:4: warning: assignment to 'char *' from incompatible pointer type 'zend_string *' {aka 'struct _zend_string *'} [-Wincompatible-pointer-types]
s = resource->host;
^
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:312:24: error: invalid operands to binary == (have 'zend_string' {aka 'struct _zend_string'} and 'int')
if (resource->host[0] == 0 && context && psftp &&
~~~~~~~~~~~~~~~~~ ^~
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:326:24: error: invalid operands to binary == (have 'zend_string' {aka 'struct _zend_string'} and 'int')
if (resource->host[0] == 0 && context &&
~~~~~~~~~~~~~~~~~ ^~
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:402:28: warning: passing argument 1 of 'strlen' from incompatible pointer type [-Wincompatible-pointer-types]
int len = strlen(resource->user);
~~~~~~~~^~~~~~
In file included from /usr/local/include/php/main/../main/php_config.h:2616,
from /usr/local/include/php/Zend/zend_config.h:1,
from /usr/local/include/php/Zend/zend_portability.h:43,
from /usr/local/include/php/Zend/zend_types.h:25,
from /usr/local/include/php/Zend/zend.h:27,
from /usr/local/include/php/main/php.h:33,
from /tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:25:
/usr/include/string.h:384:35: note: expected 'const char *' but argument is of type 'zend_string *' {aka 'struct _zend_string *'}
extern size_t strlen (const char *__s)
~~~~~~~~~~~~^~~
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:405:13: warning: assignment to 'char *' from incompatible pointer type 'zend_string *' {aka 'struct _zend_string *'} [-Wincompatible-pointer-types]
username = resource->user;
^
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:411:28: warning: passing argument 1 of 'strlen' from incompatible pointer type [-Wincompatible-pointer-types]
int len = strlen(resource->pass);
~~~~~~~~^~~~~~
In file included from /usr/local/include/php/main/../main/php_config.h:2616,
from /usr/local/include/php/Zend/zend_config.h:1,
from /usr/local/include/php/Zend/zend_portability.h:43,
from /usr/local/include/php/Zend/zend_types.h:25,
from /usr/local/include/php/Zend/zend.h:27,
from /usr/local/include/php/main/php.h:33,
from /tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:25:
/usr/include/string.h:384:35: note: expected 'const char *' but argument is of type 'zend_string *' {aka 'struct _zend_string *'}
extern size_t strlen (const char *__s)
~~~~~~~~~~~~^~~
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:414:13: warning: assignment to 'char *' from incompatible pointer type 'zend_string *' {aka 'struct _zend_string *'} [-Wincompatible-pointer-types]
password = resource->pass;
^
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:425:45: warning: passing argument 1 of 'php_ssh2_session_connect' from incompatible pointer type [-Wincompatible-pointer-types]
session = php_ssh2_session_connect(resource->host, resource->port, methods, callbacks);
~~~~~~~~^~~~~~
In file included from /tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:26:
/tmp/pear/temp/ssh2/php_ssh2.h:151:18: note: expected 'char *' but argument is of type 'zend_string *' {aka 'struct _zend_string *'}
LIBSSH2_SESSION *php_ssh2_session_connect(char *host, int port, zval *methods, zval *callbacks);
^~~~~~~~~~~~~~~~~~~~~~~~
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c: In function 'php_ssh2_fopen_wrapper_shell':
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:634:4: warning: assignment to 'char *' from incompatible pointer type 'zend_string *' {aka 'struct _zend_string *'} [-Wincompatible-pointer-types]
s = resource->path ? resource->path : NULL;
^
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c: In function 'php_ssh2_fopen_wrapper_exec':
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:881:70: warning: passing argument 3 of 'php_ssh2_exec_command' from incompatible pointer type [-Wincompatible-pointer-types]
stream = php_ssh2_exec_command(session, resource_id, resource->path + 1, terminal, terminal_len, environment, width, height, type);
~~~~~~~~~~~~~~~^~~
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:737:91: note: expected 'char *' but argument is of type 'zend_string *' {aka 'struct _zend_string *'}
static php_stream *php_ssh2_exec_command(LIBSSH2_SESSION *session, int resource_id, char *command, char *term, int term_len, zval *environment, long width, long height, long type)
~~~~~~^~~~~~~
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c: In function 'php_ssh2_fopen_wrapper_scp':
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:1024:59: warning: passing argument 3 of 'php_ssh2_scp_xfer' from incompatible pointer type [-Wincompatible-pointer-types]
stream = php_ssh2_scp_xfer(session, resource_id, resource->path);
~~~~~~~~^~~~~~
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:970:87: note: expected 'char *' but argument is of type 'zend_string *' {aka 'struct _zend_string *'}
static php_stream *php_ssh2_scp_xfer(LIBSSH2_SESSION *session, int resource_id, char *filename)
~~~~~~^~~~~~~~
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c: In function 'php_ssh2_fopen_wrapper_tunnel':
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:1265:42: error: invalid operands to binary == (have 'zend_string' {aka 'struct _zend_string'} and 'int')
if (resource->path && resource->path[0] == '/') {
~~~~~~~~~~~~~~~~~ ^~
/tmp/pear/temp/ssh2/ssh2_fopen_wrappers.c:1268:8: warning: assignment to 'char *' from incompatible pointer type 'zend_string *' {aka 'struct _zend_string *'} [-Wincompatible-pointer-types]
host = resource->path + 1;
^
make: *** [Makefile:196: ssh2_fopen_wrappers.lo] Error 1
ERROR: `make' failed
ERROR: Service 'php-fpm' failed to build: The command '/bin/sh -c if [ ${INSTALL_SSH2} = true ]; then apt-get -y install libssh2-1-dev && if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then pecl install -a ssh2-0.13; else pecl install -a ssh2-1.1.2; fi && docker-php-ext-enable ssh2 ;fi' returned a non-zero code: 1

@diorgesl
Copy link
Author

Figured it out, was the PHP 7.3. Just use 7.2 and youre fine!

@webard
Copy link

webard commented Feb 3, 2020

To support PHP 7.3 and 7.4 php-fpm/Dockerfile from line 80 should look like this:

RUN if [ ${INSTALL_SSH2} = true ]; then \
    # Install the ssh2 extension
    apt-get -y install libssh2-1-dev && \
    if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
        pecl install -a ssh2-0.13; \
    elif [ ${LARADOCK_PHP_VERSION} = "7.3" ] || [ ${LARADOCK_PHP_VERSION} = "7.4" ]; then \
        pecl install -a ssh2-1.2; \
    else \
        pecl install -a ssh2-1.1.2; \
    fi && \
    docker-php-ext-enable ssh2 \
;fi

PHP versions 7.3 and above needs beta version of SSH2 package.

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