LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Issue with setup (https://www.linuxquestions.org/questions/linux-newbie-8/issue-with-setup-4175671865/)

Anderson_1991 03-23-2020 11:38 PM

Issue with setup
 
Hi,
I did the setup, per steps below

https://medium.com/@nahomt/using-sql...4-c85671249c45

but now sqlsrv.so and pdo_sqlsrv.so are not inside /usr/lib/php/20170718. Please help.

pan64 03-24-2020 02:13 AM

I found this (on that page):
Quote:

Make sure that the two driver files (sqlsrv.so and pdo_sqlsrv.so) have been added to /usr/lib/php/20170718 (your path might be different, just check your php dynamic libraries path)

Anderson_1991 03-25-2020 02:10 AM

Sorry to that I cannot find out the file like

Quote:

find . -name sqlsrv.*
within the machine.

pan64 03-25-2020 02:16 AM

probably: find /usr/lib -name ..... (or something similar)

Anderson_1991 03-25-2020 02:34 AM

Sorry to that I get no details like

Quote:

root@ubuntu:/usr/lib# find /usr/lib/ -name sqlsrv.*
root@ubuntu:/usr/lib#

pan64 03-25-2020 02:45 AM

That is strange. Try this:
Code:

find /usr/lib/ /lib /opt -name '*sqlsrv*'

# or if works:
updatedb
locate sqlsrv


Anderson_1991 03-25-2020 02:59 AM

Sorry, can you help?

Quote:

root@ubuntu1604:/usr/lib# find /usr/lib /usr /opt -name '*sqlsrv*'
/usr/share/php/docs/sqlsrv
/usr/share/php/docs/pdo_sqlsrv
root@ubuntu1604:/usr/share/php/docs/pdo_sqlsrv# updatedb
root@ubuntu1604:/usr/share/php/docs/pdo_sqlsrv# locate sqlsrv
root@ubuntu1604:/usr/lib# cd /usr/share/php/docs/sqlsrv
root@ubuntu1604:/usr/share/php/docs/sqlsrv# ls -l
total 0
root@ubuntu1604:/usr/share/php/docs/sqlsrv# cd /usr/share/php/docs/pdo_sqlsrv
root@ubuntu1604:/usr/share/php/docs/pdo_sqlsrv# ls -l
total 0

pan64 03-25-2020 03:14 AM

so return back to the original post and link, I think the installation (step 2) was not successful.

Anderson_1991 03-25-2020 04:09 AM

When running "pecl install sqlsrv", i got issue below
Quote:

#include <sql.h>
^~~~~~~
compilation terminated.
Makefile:194: recipe for target 'conn.lo' failed
make: *** [conn.lo] Error 1
ERROR: `make' failed

pan64 03-25-2020 04:19 AM

Yes, that is an error message, and that explains why didn't you find the files. But need to see more lines (above).

Anderson_1991 03-25-2020 04:44 AM

FYI

Quote:

...
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
running: make
/bin/bash /tmp/pear/temp/pear-build-rootEYD5tf/sqlsrv-5.8.0/libtool --mode=compile g++ -std=c++11 -I. -I/tmp/pear/temp/sqlsrv -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootEYD5tf/sqlsrv-5.8.0/include -I/tmp/pear/temp/pear-build-rootEYD5tf/sqlsrv-5.8.0/main -I/tmp/pear/temp/sqlsrv -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib -I/tmp/pear/temp/sqlsrv/shared/ *-DHAVE_CONFIG_H *-std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector * -c /tmp/pear/temp/sqlsrv/conn.cpp -o conn.lo
libtool: compile: *g++ -std=c++11 -I. -I/tmp/pear/temp/sqlsrv -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootEYD5tf/sqlsrv-5.8.0/include -I/tmp/pear/temp/pear-build-rootEYD5tf/sqlsrv-5.8.0/main -I/tmp/pear/temp/sqlsrv -I/usr/include/php/20180731 -I/usr/include/php/20180731/main -I/usr/include/php/20180731/TSRM -I/usr/include/php/20180731/Zend -I/usr/include/php/20180731/ext -I/usr/include/php/20180731/ext/date/lib -I/tmp/pear/temp/sqlsrv/shared/ -DHAVE_CONFIG_H -std=c++11 -D_FORTIFY_SOURCE=2 -O2 -fstack-protector -c /tmp/pear/temp/sqlsrv/conn.cpp *-fPIC -DPIC -o .libs/conn.o
In file included from /tmp/pear/temp/sqlsrv/shared/typedefs_for_linux.h:23:0,
* * * * * * * * *from /tmp/pear/temp/sqlsrv/shared/xplat_winnls.h:24,
* * * * * * * * *from /tmp/pear/temp/sqlsrv/shared/FormattedPrint.h:24,
* * * * * * * * *from /tmp/pear/temp/sqlsrv/shared/core_sqlsrv.h:41,
* * * * * * * * *from /tmp/pear/temp/sqlsrv/php_sqlsrv_int.h:25,
* * * * * * * * *from /tmp/pear/temp/sqlsrv/conn.cpp:24:
/tmp/pear/temp/sqlsrv/shared/xplat.h:30:10: fatal error: sql.h: No such file or directory
*#include <sql.h>
* * * * * ^~~~~~~
compilation terminated.
Makefile:194: recipe for target 'conn.lo' failed
make: *** [conn.lo] Error 1
ERROR: `make' failed

pan64 03-25-2020 04:53 AM

there was a step1: install unixodbc-dev, it looks like that did not happen (or was not successful).

Anderson_1991 03-26-2020 10:30 AM

I can see PHP 7.2 in my Ubuntu (version 16) but I cannot start php7.2-fpm. Why?

Quote:

root@ubuntu :/etc/php# ls -l
total 8
drwxr-xr-x 4 root root 4096 Mar 23 16:48 7.2
drwxr-xr-x 5 root root 4096 Oct 12 19:46 7.3
root@ubuntu :/etc/php# restart php7.2-fpm

Command 'restart' not found, did you mean:

command 'rstart' from deb x11-session-utils
command 'restartd' from deb restartd

Try: apt install <deb name>

pan64 03-26-2020 10:36 AM

probably: service restart <name>, but actually it is only a guess. You cannot start/restart an fpm I do not really understand that.

Anderson_1991 03-27-2020 04:00 AM

The material below

https://medium.com/@nahomt/using-sql...4-c85671249c45

does request to restart php-fpm, after the setup.


All times are GMT -5. The time now is 10:35 AM.