Я установил php fann (https://github.com/bukka/php-fann) на сервере Ubuntu 16, вот вывод консоли:
sudo apt-get install libfann-*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libfann-dbg' for glob 'libfann-*'
Note, selecting 'libfann-dev' for glob 'libfann-*'
Note, selecting 'libfann-doc' for glob 'libfann-*'
The following NEW packages will be installed:
libfann-dbg libfann-dev libfann-doc
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/1,860 kB of archives.
After this operation, 14.2 MB of additional disk space will be used.
Selecting previously unselected package libfann-dev:amd64.
(Reading database ... 86590 files and directories currently installed.)
Preparing to unpack .../libfann-dev_2.2.0+ds-2_amd64.deb ...
Unpacking libfann-dev:amd64 (2.2.0+ds-2) ...
Selecting previously unselected package libfann-doc.
Preparing to unpack .../libfann-doc_2.2.0+ds-2_all.deb ...
Unpacking libfann-doc (2.2.0+ds-2) ...
Selecting previously unselected package libfann-dbg:amd64.
Preparing to unpack .../libfann-dbg_2.2.0+ds-2_amd64.deb ...
Unpacking libfann-dbg:amd64 (2.2.0+ds-2) ...
Setting up libfann-dev:amd64 (2.2.0+ds-2) ...
Setting up libfann-doc (2.2.0+ds-2) ...
Setting up libfann-dbg:amd64 (2.2.0+ds-2) ...
Кажется, что нет ошибок, но когда я пытаюсь вызвать fann_create_from_file (), я получаю:
Call to undefined function fann_create_from_file() in /var/www/html/../somefile.php on line XX
Что может быть не так? Я работаю с PHP 5.6, может ли apt-get настроить lib fann для более старой (или другой) установки php?
Обновление 1
Я тоже пробовал sudo apt-get установить libfann-dev
Обновление 2
Та же проблема на Ubuntu 14
sudo apt-get install libfann-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
libfann-doc
The following NEW packages will be installed:
libfann-dev
0 upgraded, 1 newly installed, 0 to remove and 199 not upgraded.
Need to get 0 B/176 kB of archives.
After this operation, 703 kB of additional disk space will be used.
Selecting previously unselected package libfann-dev.
(Reading database ... 56278 files and directories currently installed.)
Preparing to unpack .../libfann-dev_2.1.0~beta~dfsg-8ubuntu1_amd64.deb ...
Unpacking libfann-dev (2.1.0~beta~dfsg-8ubuntu1) ...
Setting up libfann-dev (2.1.0~beta~dfsg-8ubuntu1) ...
Бег:
Call to undefined function fann_create_from_file
Обновление 3
Я скомпилировал библиотеку «fann.so» под управлением:
git clone --recursive https://github.com/bukka/php-fann.git
cd php-fann
phpize
./configure --with-fann
make
sudo make install
Процесс сборки успешно запущен, поэтому я добавил «fann.so» в мой PHP.ini и получил:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20131226/fann.so' - /usr/lib/php/20131226/fann.so: undefined symbol: zend_list_close in Unknown on line 0
Наконец я смог заставить его работать:
Других решений пока нет …