Koozali.org formerly Contribs.org

php openbasedic

php openbasedic
« on: December 07, 2019, 07:16:59 PM »
bonjour,

# db accounts setprop convertcsv  PHPBaseDir /home/e-smith/files/ibays/convertcsv/:/tmp/
# signal-event ibay-modify convertcsv

Et cela ne revient jamais à la ligne...
bloqué donc
ctrl-C

Cela a bien mis à jour

# db accounts show convertcsv
convertcsv=ibay
    CgiBin=enabled
    Gid=5066
    Group=shared
    Name=convert csv- vcf
    PHPBaseDir=/home/e-smith/files/ibays/convertcsv/:/tmp/
    PasswordSet=no
    PublicAccess=global
    SSL=enabled
    Uid=5066
    UserAccess=wr-group-rd-everyone


Pourquoi le 'signal-event ibay-modify' est bloqué?

et j'ai toujours dans les logs
Dec  7 18:42:18 tux httpd: PHP Warning:  Unknown: open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/home/e-smith/files/ibays/convertcsv/) in Unknown on line 0
Dec  7 18:42:18 tux httpd: PHP Warning:  File upload error - unable to create a temporary file in Unknown on line 0

Si quelqu'un a une idée

Anne
« Last Edit: December 07, 2019, 07:19:00 PM by ecureuil »

Re: php openbasedic
« Reply #1 on: December 11, 2019, 09:45:58 AM »
Bonjour,

C'est une erreur PHP. Quelles sont les valeurs des paramètres d'upload ?

Code: [Select]
fgrep upload /etc/php.ini

Tu peux avoir quelque chose comme :

file_uploads                           = On
upload_max_filesize                    = 10M
upload_tmp_dir          = /var/lib/php/tmp

Online ReetP

  • *
  • 2,503
Re: php openbasedic
« Reply #2 on: December 11, 2019, 07:54:43 PM »
I think there was some work on adding a tmpdir to ibays but I cannot find it.

I have this template fragment you can test:

cat /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/95AddType00PHP2ibays
Code: [Select]
{
    my $status = $php{status} || 'disabled';
    if ($status eq 'enabled')
    {
use esmith::AccountsDB;
my $adb = esmith::AccountsDB->open_ro();
foreach my $ibay ($adb->ibays)
{
    local $dynamicContent = $ibay->prop('CgiBin') || 'disabled';
    if ($dynamicContent eq 'enabled')
    {
$OUT .= "\n<Directory /home/e-smith/files/ibays/" . $ibay->key . "/html>\n";
$OUT .= "    AddType application/x-httpd-php .php .php3 .phtml\n";
$OUT .= "    AddType application/x-httpd-php-source .phps\n";

# Set the sandbox within which PHP is confined to play
my $basedir = $ibay->prop('PHPBaseDir')
    || ("/home/e-smith/files/ibays/" . $ibay->key . "/");
$OUT .= "    php_admin_value open_basedir $basedir\n";

# Set the upload_tmp_folder where php can upload files
my $tmpdir = $ibay->prop('PHPTmpDir') || 'enabled';
$tmpdir = ('/home/e-smith/files/ibays/' . $ibay->key . '/tmp') if $tmpdir eq 'enabled';
        $OUT .= "    php_admin_value upload_tmp_dir $tmpdir\n" unless $tmpdir eq 'disabled';


$OUT .= "</Directory>\n";
    }
}
    }
}

[root@test testbay]# ll
total 16
drwxrwsr-x  2 root   shared 4096 Jul 31 09:39 cgi-bin
drwxrwsr-x 52 root   shared 4096 Aug 31 13:19 files
drwxrwsr-x 98 root   shared 4096 Dec  9 14:23 html
drwxrwsr-x  2 apache shared 4096 Dec  6 13:31 tmp

testbay=ibay
    CgiBin=enabled
    Gid=5014
    Group=shared
    Name=Test iBay

>>>>> I could remove /tmp !!!!
    PHPBaseDir=/home/e-smith/files/ibays/testbay/html/:/home/e-smith/files/ibays/testbay/html/tmp/:/tmp/:/opt/remi/php71/root/usr/share/pear/:/usr/share/GeoIP

    PHPTmpDir=enabled
    PHPUploadDir=/home/e-smith/files/ibays/testbay/html/tmp/
    PasswordSet=yes
    PublicAccess=global
    SSL=enabled
    Uid=5014
    UserAccess=wr-group-rd-everyone
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions
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

Re: php openbasedic
« Reply #3 on: December 11, 2019, 11:48:00 PM »
Je viens de créer une nouvelle ibay où j'ai besoin de /temp

Pas bien compris ce que ReetP a voulu faire.

La dernière fois j'ai rebooté et je n'avais plus l'erreur
PHP Warning:  Unknown: open_basedir restriction in effect. File(/tmp) is not within the allowed path(...

Je crois que je vais refaire un reboot de ma sme

Anne

Online ReetP

  • *
  • 2,503
Re: php openbasedic
« Reply #4 on: December 12, 2019, 02:35:36 PM »
Sorry I was rushing.

Code: [Select]
mkdir /home/e-smith/files/ibays/{some-ibay}/html/tmp/
Copy template fragment 95AddType00PHP2ibays to templates-custom.

db accounts setprop {some-ibay} PHPTmpDir enabled

signal-event console-save (or post-upgrade/reboot)

This should set:

Code: [Select]
php_admin_value upload_tmp_dir /home/e-smith/files/ibays/{some-ibay}/tmp
Test with phpinfo()

You can also then try adding the ..tmp dir here:

Code: [Select]
db accounts setprop testbay PHPBaseDir /home/e-smith/files/ibays/{some-ibay}/html/:/home/e-smith/files/ibays/{some-ibay}/tmp/:tmp
Note that Jean Philippe is working on a solution for this for SME v10
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions
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 Jean-Philippe Pialasse

  • *
  • 1,480
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: php openbasedic
« Reply #5 on: December 16, 2019, 12:38:40 AM »
pour le signal-event qui rend pas la main ouvre un deuxieme shel et lance tail -f /var/log/messages avant de lancer la commande, tu devrais voir les erreurs et surtout quelle commande reste en suspend

Re: php openbasedic
« Reply #6 on: January 07, 2020, 05:02:32 AM »
bonjour,

Cela fait 2 fois que je fais
# db accounts setprop  convert-csv1 PHPBaseDir /home/e-smith/files/ibays/convert-csv1/:/tmp/
# signal-event ibay-modify convert-csv1

La première commande c'est rapide.
La deuxième c'est très très long.

log message

Jan  6 23:15:32 tux httpd: PHP Warning:  Unknown: open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/home/e-smith/files/ibays/convert-csv1/) in Unknown on line 0
Jan  6 23:15:32 tux httpd: PHP Warning:  File upload error - unable to create a temporary file in Unknown on line 0

Jan  6 23:27:28 tux /sbin/e-smith/db[18522]: /home/e-smith/db/accounts: OLD convert-csv1=ibay|CgiBin|enabled|Gid|5070|Group|shared|Name|convert csv- vcf 1|PasswordSet|no|PublicAccess|global|SSL|enabled|Uid|5070|UserAccess|wr-group-rd-everyone
Jan  6 23:27:28 tux /sbin/e-smith/db[18522]: /home/e-smith/db/accounts: NEW convert-csv1=ibay|CgiBin|enabled|Gid|5070|Group|shared|Name|convert csv- vcf 1|PHPBaseDir|/home/e-smith/files/ibays/convert-csv1/:/tmp/|PasswordSet|no|PublicAccess|global|SSL|enabled|Uid|5070|UserAccess|wr-group-rd-everyone

Jan  6 23:28:04 tux esmith::event[18526]: Processing event: ibay-modify convert-csv1
Jan  6 23:28:04 tux esmith::event[18526]: Running event handler: /etc/e-smith/events/actions/generic_template_expand
Jan  6 23:28:04 tux esmith::event[18526]: expanding /etc/services
Jan  6 23:28:04 tux esmith::event[18526]: expanding /etc/proftpd.conf
Jan  6 23:28:04 tux esmith::event[18526]: expanding /etc/securetty
Jan  6 23:28:04 tux esmith::event[18526]: expanding /etc/hosts.deny
Jan  6 23:28:04 tux esmith::event[18526]: expanding /etc/shells
Jan  6 23:28:04 tux esmith::event[18526]: expanding /etc/hosts.allow
Jan  6 23:28:04 tux esmith::event[18526]: expanding /etc/samba/smbusers
Jan  6 23:28:04 tux esmith::event[18526]: expanding /etc/samba/smb.conf
Jan  6 23:28:05 tux esmith::event[18526]: expanding /etc/httpd/conf/httpd.conf
Jan  6 23:28:05 tux esmith::event[18526]: generic_template_expand=action|Event|ibay-modify|Action|generic_template_expand|Start|1578349684 77382|End|1578349685 665104|Elapsed|1.587722
Jan  6 23:28:05 tux esmith::event[18526]: Running event handler: /etc/e-smith/events/ibay-modify/S15ibay-modify
Jan  6 23:28:06 tux esmith::event[18526]: User convert-csv1 successfully modified!
Jan  6 23:28:06 tux esmith::event[18526]: S15ibay-modify=action|Event|ibay-modify|Action|S15ibay-modify|Start|1578349685 665966|End|1578349686 21424|Elapsed|0.355458
Jan  6 23:28:06 tux esmith::event[18526]: Running event handler: /etc/e-smith/events/ibay-modify/S30nextcloud-occ-conf
Jan  6 23:28:08 tux esmith::event[18526]: System config value trusted_domains => 0 set to string tux.xxxx.com
Jan  6 23:28:08 tux esmith::event[18526]: System config value trusted_domains => 1 set to string tux
Jan  6 23:28:09 tux esmith::event[18526]: System config value trusted_domains => 2 set to string xxxx.com
Jan  6 23:28:10 tux esmith::event[18526]: System config value trusted_domains => 3 set to string localhost
Jan  6 23:28:11 tux esmith::event[18526]: System config value trusted_domains => 4 set to string 10.97.1.1
Jan  6 23:28:11 tux esmith::event[18526]: System config value trusted_domains => 5 set to string 82.66.111.244
Jan  6 23:28:13 tux esmith::event[18526]: files_external enabled
Jan  6 23:28:14 tux esmith::event[18526]: System config value memcache.local set to string \OC\Memcache\APCu
Jan  6 23:28:56 tux esmith::event[18526]: Set mode for background jobs to 'cron'
Jan  6 23:28:57 tux esmith::event[18526]: S30nextcloud-occ-conf=action|Event|ibay-modify|Action|S30nextcloud-occ-conf|Start|1578349686 21970|End|1578349737 17351|Elapsed|50.995381
Jan  6 23:28:57 tux esmith::event[18526]: Running event handler: /etc/e-smith/events/actions/adjust-services
Jan  6 23:28:57 tux esmith::event[18526]: adjusting supervised httpd-e-smith (sigusr1)
Jan  6 23:28:57 tux esmith::event[18526]: adjusting supervised httpd-e-smith (up)
Jan  6 23:28:57 tux esmith::event[18526]: adjusting supervised smbd (sighup)
Jan  6 23:28:57 tux esmith::event[18526]: adjusting supervised smbd (up)
Jan  6 23:28:57 tux esmith::event[18526]: adjust-services=action|Event|ibay-modify|Action|adjust-services|Start|1578349737 17941|End|1578349737 152855|Elapsed|0.134914
Jan  6 23:28:57 tux esmith::event[18526]: Running event handler: /etc/e-smith/events/ibay-modify/S95ldap-update-simple
Jan  6 23:28:57 tux esmith::event[18526]: S95ldap-update-simple=action|Event|ibay-modify|Action|S95ldap-update-simple|Start|1578349737 153340|End|1578349737 657696|Elapsed|0.504356

C'est nextcloud qui met à jour sa base qui fait que c'est long?

Anne
« Last Edit: January 07, 2020, 01:01:57 PM by ecureuil »

Offline Jean-Philippe Pialasse

  • *
  • 1,480
  • aka Unnilennium
    • http://smeserver.pialasse.com
Re: php openbasedic
« Reply #7 on: January 08, 2020, 01:32:22 AM »
Nextcloud ecrit dans ldap ce qui est un processus très tres tres tres looooooooooonnnnnnnng.

Re: php openbasedic
« Reply #8 on: March 16, 2020, 08:52:04 PM »
J'ai mis PHP Software Collections et je suis passée avec la version 7.3 pour 3 de mes ibays?

Il a fallu que je refasse les openbasedir...

C'est toujours aussi long signal-event ibay-modify ...
Je suis allée boire un café...

Anne