Koozali.org: home of the SME Server

dbase extension on SME 10

Offline umbi

  • ***
  • 100
  • +0/-0
dbase extension on SME 10
« 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
« Last Edit: February 17, 2024, 02:58:54 AM by umbi »

Offline mmccarn

  • *
  • 2,627
  • +10/-0
Re: dbase extension on SME 10
« Reply #1 on: February 17, 2024, 05:06:17 AM »
[caveat - I have not done this!]

It looks as though the 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 repo, then running a command like this:
Code: [Select]
yum install php82-php-pecl-dbase

Offline ReetP

  • *
  • 3,740
  • +5/-0
Re: dbase extension on SME 10
« Reply #2 on: February 17, 2024, 11:54:27 AM »
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.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline umbi

  • ***
  • 100
  • +0/-0
Re: dbase extension on SME 10
« Reply #3 on: February 17, 2024, 12:43:35 PM »
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

Offline ReetP

  • *
  • 3,740
  • +5/-0
Re: dbase extension on SME 10
« Reply #4 on: February 17, 2024, 02:09:28 PM »
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:

Quote
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.
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline ReetP

  • *
  • 3,740
  • +5/-0
Re: dbase extension on SME 10
« Reply #5 on: February 17, 2024, 02:13:16 PM »
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline umbi

  • ***
  • 100
  • +0/-0
Re: dbase extension on SME 10
« Reply #6 on: February 17, 2024, 02:58:39 PM »
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!

Online Jean-Philippe Pialasse

  • *
  • 2,765
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: dbase extension on SME 10
« Reply #7 on: February 17, 2024, 03:05:32 PM »
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

Online Jean-Philippe Pialasse

  • *
  • 2,765
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: dbase extension on SME 10
« Reply #8 on: February 17, 2024, 03:25:07 PM »
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
« Last Edit: February 17, 2024, 03:27:20 PM by Jean-Philippe Pialasse »

Offline umbi

  • ***
  • 100
  • +0/-0
Re: dbase extension on SME 10
« Reply #9 on: February 17, 2024, 03:33:34 PM »
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);
« Last Edit: February 17, 2024, 03:36:33 PM by umbi »

Offline ReetP

  • *
  • 3,740
  • +5/-0
Re: dbase extension on SME 10
« Reply #10 on: February 17, 2024, 04:18:03 PM »
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

Code: [Select]
<?php
$db 
dbase_open("/home/e-smith/files/ibays/ib_my-ibay/html/TEST.DBF",0);

You call the script with

Code: [Select]
/usr/bin/php82 ./myscript.php
You need to explain in more detail how you actually use this, or do a lot more reading....

...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline umbi

  • ***
  • 100
  • +0/-0
Re: dbase extension on SME 10
« Reply #11 on: February 17, 2024, 05:02:49 PM »
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.