Comments (6)
Hello.
It seems that builded extension in another directory.
At the end of CMakeLists.txt you can see next commands:
add_custom_command(TARGET ${EXT_NAME}
POST_BUILD
COMMAND echo 'extension=${CMAKE_SHARED_LIBRARY_PREFIX}${EXT_NAME}.so' > ${EXT_INI_FILE}
COMMAND sudo cp -f ${EXT_INI_FILE}; ${PHP_CONFIG_DIR}
COMMAND rm -f ${EXT_INI_FILE}
COMMAND sudo cp -f $<TARGET_FILE:${EXT_NAME}> ${PHP_EXTENSIONS_DIR}
COMMAND rm -f $<TARGET_FILE:${EXT_NAME}>
)
Extension (tdlib.so) copied into PHP_CONFIG_DIR, which taken from
php-config --configure-options | sed -ne "s/^.*--with-config-file-scan-dir=\\([^ ]*\\).*/\\1/p"
If there is extension file - just edit path in php.ini with included tdlib extension. If no - are you sure that extension was successfully builded?
I tested only on OpenSUSE and not sure if CMakeLists work properly on other OS.
And you can use docker for demo (see in README) =)
from phptdlib.
Собралось всё без ошибок, пути проверял.
На SUSE всё работает, но его к сожалению нет на digitalocean.com
sorry my bad english
from phptdlib.
@dwap скопируй сюда, пожалуйста, вывод команды что я выше написал: php-config --configure-options | sed -ne "s/^.*--with-config-file-scan-dir=\\([^ ]*\\).*/\\1/p"
(или полностью php-config
). Потом скопируй сюда вывод команды ls -la /usr/lib64/php/modules
. Так же найди где находсятся файлы tdlib.ini
tdlib.so
и покажи содержимое ini-файла.
Еще раз перечитал сообщение о ошибке. Заметил /usr/lib64/php/modules/tdlib.so .so. Есть подозрение, что в tdlib.ini нужно писать extension=tdlib
вместо extension=tdlib.so
Кстати, на сервере точно php7? Насколько я помню - в Centos7 по дефолту php5 (php -v
). Хотя должно было выкинуть ошибку, что требует 7-ой.
Я попробую собрать докерфайл для centos7 без компиляции td/tdlib (просто так будет быстрее =) ) и разобраться, в чём проблема.
from phptdlib.
Вобщем, вот Dockerfile с centos, что я использовал:
FROM centos:latest
LABEL maintainer="[email protected]"
RUN yum update -y &&\
yum install epel-release yum-utils -y &&\
yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm -y &&\
yum-config-manager --enable remi-php72 &&\
yum install php php-devel php-ctype php-json -y &&\
yum install centos-release-scl -y &&\
yum install devtoolset-7-gcc-c++ -y &&\
scl enable devtoolset-7 bash &&\
yum install zlib gperf openssl openssl-devel cmake3 sudo git -y
[root@163e316c75dc /]# cat /etc/centos-release
CentOS Linux release 7.5.1804 (Core)
[root@163e316c75dc /]# php-config --configure-options | sed -ne "s/^.*--with-config-file-scan-dir=\\([^ ]*\\).*/\\1/p"
/etc/php.d
[root@163e316c75dc /]# php-config --extension-dir
/usr/lib64/php/modules
[root@163e316c75dc /]# php -v
PHP 7.2.12 (cli) (built: Nov 6 2018 16:40:25) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
Собрал пустое расширение (вырезал все зависимости)
[root@163e316c75dc build]# cmake3 ..
-- Configuring done
-- Generating done
-- Build files have been written to: /root/phptdlib/build
[root@163e316c75dc build]# make
[ 50%] Linking CXX shared library tdlib.so
[100%] Built target tdlib
И потом проверил есть ли:
[root@163e316c75dc modules]# ls /etc/php.d
20-bz2.ini 20-ctype.ini 20-exif.ini 20-ftp.ini 20-iconv.ini 20-phar.ini 20-tokenizer.ini
20-calendar.ini 20-curl.ini 20-fileinfo.ini 20-gettext.ini 20-json.ini 20-sockets.ini tdlib.ini
[root@163e316c75dc modules]# ls /usr/lib64/php/modules/
bz2.so calendar.so ctype.so curl.so exif.so fileinfo.so ftp.so gettext.so iconv.so json.so phar.so sockets.so tdlib.so tokenizer.so
Как видно есть. Но т.к расширение пустое - выдаёт PHP Warning: PHP Startup: Invalid library (maybe not a PHP library) 'tdlib.so' in Unknown on line 0
. Это уже надо собирать и тестить полностью.
from phptdlib.
@dwap проблему-то решил? =) Если да - в чем была проблема?
from phptdlib.
Нет, не решил.
Принял решение сделать на питоне, необходимо постоянное подключение и на все процессы.
from phptdlib.
Related Issues (20)
- /usr/include/phpcpp/throwable.h:29:1: error: expected class-name before ‘{’ token HOT 3
- Valid api_id must be provided. Can be obtained at https://my.telegram.org HOT 4
- SendMessage Issue HOT 4
- What is the problem?The server system is centos7
- Setup on WIndows 10 HOT 1
- How do I upgrade tdlib from version 1.8.10 to the latest 1.8.25? HOT 6
- more example HOT 1
- TDApi and TDLib not visible on PHP HOT 13
- TdConfig.cmake version: unknown HOT 13
- Please add example callback definition on new message event HOT 1
- Error while cmake HOT 1
- how to add a contact with phptdlib? HOT 4
- How to send a message to a newly added contact.? HOT 7
- how to integrate phptdlib in laravel HOT 1
- importContacts causes an error HOT 4
- how to accept terms of service in authorizationStateWaitRegistration? HOT 4
- Migrate from Travis CI to Github Actions
- setAuthenticationPhoneNumber Verify phone number timed out HOT 8
- Compile error on MessagesManager.cpp.o HOT 2
- Fatal error when git cloning this repo (submodules): "The unauthenticated git protocol on port 9418 is no longer supported."
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phptdlib.