Koozali.org: home of the SME Server
Contribs.org Forums => Koozali SME Server 10.x Contribs => Topic started by: umbi on February 17, 2024, 02:56:23 AM
-
Hi there
If I ask my question in the wrong thread, I apologize.
I replaced a V9.2 with a V10 server.
I have a script running in an Ibay that reads dbase files and writes them to a database. Unfortunately I can't do this anymore under sme v10, probably because I can't get the dbase extension to work.
I proceeded as follows:
For example, in the server manager I installed the file: php80-php-pecl-dbase.x86_64 5.1.1.1.el7.remi - remi-safe.
I activated allow_url_fopen + Allow parsing php code inside html, phtml, htm and xml files on the ibay.
All configurations are looking for me same as on the old v9.2 machine where the script worked.
My question: do i still have to activate the dbase extension somewhere? It looks like it is not parsing the dbase data.
I also tried different PHP versions.
# /sbin/e-smith/audittools/newrpms |grep php
phpMyAdmin.noarch 5.1.0-1.el7.sme @smecontribs
phpldapadmin.noarch 1.2.6-4.el7.sme @smecontribs
smeserver-phpldapadmin.noarch 1.6.0-9.el7.sme @smecontribs
smeserver-phpmyadmin.noarch 4.0.10.2-14.el7.sme @smecontribs
[root@server ~]#
Thank you in advance for your help
-
[caveat - I have not done this!]
It looks as though the remi-safe (https://wiki.koozali.org/Remi-safe) repository has an rpm named php82-php-pecl-dbase.x86_64 (along with versions for other versions of PHP)
So - maybe you can get what you need by installing the remi-safe (https://wiki.koozali.org/Remi-safe) repo, then running a command like this:
yum install php82-php-pecl-dbase
-
Also note that SME 10 uses php-fpm so enabling this is NOT the same as it would be on v9.
There is info on the wiki, and plenty of threads on here where people have enabled various items.
You need to have a good read.
-
Thank you for the answers
ReetP
Can you please give me a hint as to what I should search for in the forum?
Of course, I always search before I ask something so that questions don't arise more than once, but I didn't get any helpful answers using the search term "dbase".
Thank you and wish a happy weekend
-
It's less about specifics on dbase and more on how you add custom configuration options to php-fpm.
Until you master that you won't be able to manage dbase (and I have no knowledge of it)
But reading about php-fpm will show you how other extensions and configs work. So start there.
It may be loaded already but you need the right command in a terminal to check eg rather than 'php' which will give you the default installed php version you need to use say 'php82'
All of this will become clear if you read about it.
Also:
Allow parsing php code inside html, phtml, htm and xml files on the ibay.
Careful with what you don't understand. Just enabling anything in sight without understanding will only give you problems, not solutions.
-
Start here
https://wiki.koozali.org/PHP
-
Dear ReetP
I spent a lot of time to read your link.
For me its really complicated but if i combine the informations, it should be:
db accounts setprop myibay php82-php-pecl-dbase enabled
can you confirm and if its wrong can you give me please the right command line ?
Thank you in advance!
-
most probable issue: you installed the extension for php80 (and it has been suggested to install the one for php82) but as default your ibay uses php74…
yum install php*-php-pecl-dbase php-pecl-dbase
should get you mostly covered so you do not have issue running it with cli (php54) or with any php-fpm setting
-
for the extension activation it must be done depending on the default during install and it must be done for every versions installed
but according to doc it does not need
https://www.php.net/manual/en/book.dbase.php
-
Thank you so much !
i did it but its still not parsing my dbase file :-(
i activatet now in server-manager under i-bays web-hosting:
PHP-fpm (whithout a php number behind) but the test was the same - negative.
i dont know if one of that restrictions is blocking the function maybe?
List of php disabled functions (disable_functions) : system,show_source,symlink,exec,dl,shell_exec,passthru,phpinfo,escapeshellarg,escapeshellcmd
in the past that command worked:
dbase_open("/home/e-smith/files/ibays/ib_my-ibay/html/TEST.DBF",0);
-
In web hosting set it to say php82
But as I said above, if you are using a script you will have to specify the php version. Otherwise it wil use the default version on the command line eg
[root@esmith ~]# php -v
PHP 5.4.16 (cli) (built: Apr 1 2020 04:07:17)
[root@esmith ~]# php82 -v
PHP 8.2.15 (cli) (built: Jan 16 2024 12:19:32) (NTS gcc x86_64)
So you are going to have to figure out how to run that dbase_open command in a script with the correct php version
eg
[root@esmith ~]# which php82
/usr/bin/php82
I'm not sure exactly how you call that. If it is in a script like this:
Myscript.php
<?php
$db = dbase_open("/home/e-smith/files/ibays/ib_my-ibay/html/TEST.DBF",0);
You call the script with
/usr/bin/php82 ./myscript.php
You need to explain in more detail how you actually use this, or do a lot more reading....
-
Hi ReetP
infact:
~]# php -v
PHP 5.4.16 (cli) (built: Apr 1 2020 04:07:17)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
with Zend OPcache v7.0.5, Copyright (c) 1999-2015, by Zend Technologies
for test purpose i set it to 5.4 beacause on V9.2 it worket on php 5.4
my php scrypt parses the TEST.DBF and set it to php variables.
that variables put it in my local database with update command as readable data.
to debuging, i first will echo the variables and print them out on screen to see what is not going.