server icon indicating copy to clipboard operation
server copied to clipboard

PHP7: Call to undefined function OC\\\\App\\\\simplexml_load_file

Open strk opened this issue 7 years ago • 8 comments

Steps to reproduce

  1. disable php5 in apache2
  2. enable php7.0 in apache2
  3. restart apache
  4. go to nextcloud deploy url

Expected behaviour

it works as before

Actual behaviour

you get a blank page, nextcloud.log tells you:

"app":"PHP","method":"GET","url":"/settings/admin/serverinfo","message":"Error: Call to undefined function OC\App\simplexml_load_file() at lib/private/App/InfoParser.php#65"

Server configuration

Operating system: Debian 9

Web server: Apache2.4

Database: PostgreSQL

PHP version: 7.0

Nextcloud version: (see Nextcloud admin page) 13.0.12

Updated from an older Nextcloud/ownCloud or fresh install: Updated from the very early fork version

Where did you install Nextcloud from: I forgot

Signing status:

Signing status
No errors have been found.

List of activated apps:

App list
An unhandled exception has been thrown:
Error: Call to undefined function OC\App\simplexml_load_file() in ...lib/private/App/InfoParser.php:64

With php5:
Enabled:
  - activity: 2.6.1
  - calendar: 1.6.1
  - comments: 1.3.0
  - contacts: 2.1.5
  - dav: 1.4.8
  - federatedfilesharing: 1.3.1
  - federation: 1.3.0
  - files: 1.8.0
  - files_pdfviewer: 1.2.1
  - files_sharing: 1.5.0
  - files_texteditor: 2.5.1
  - files_versions: 1.6.0
  - files_videoplayer: 1.2.0 
  - firstrunwizard: 2.2.1
  - gallery: 18.0.0
  - logreader: 2.0.0
  - lookup_server_connector: 1.1.0
  - mail: 0.8.3
  - notes: 2.5.1
  - oauth2: 1.1.1
  - password_policy: 1.3.0
  - provisioning_api: 1.3.0
  - serverinfo: 1.3.0
  - sharebymail: 1.3.0
  - survey_client: 1.1.0
  - systemtags: 1.3.0
  - theming: 1.4.5
  - twofactor_backupcodes: 1.2.3
  - updatenotification: 1.3.0
  - workflowengine: 1.3.0
Disabled:
  - admin_audit
  - encryption
  - files_external
  - files_trashbin
  - nextcloud_announcements
  - notifications
  - user_external
  - user_ldap

Nextcloud configuration:

Config report
{
    "system": {
        "debug": "true",
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "oc.kbt.io"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/oc.kbt.io",
        "htaccess.RewriteBase": "\/",
        "dbtype": "pgsql",
        "version": "13.0.12.1",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "php",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "maintenance": false,
        "theme": "",
        "loglevel": 2,
        "enable_previews": false
    }
}

Are you using external storage, if yes which one: NO Are you using encryption: NO

Are you using an external user-backend, if yes which one: NO

strk avatar May 23 '19 21:05 strk

Thank you for reporting this issue :+1: We have a similar issue for a newer nextcloud version: https://github.com/nextcloud/server/issues/15642

And another report for an older version: https://github.com/nextcloud/server/issues/2180

I'm not sure if something with the code is wrong. I guess that the php-xml extension is not loaded. Mind to check your php configuration and ensure that php-xml is enabled?

kesselb avatar May 23 '19 21:05 kesselb

Installing php7.0-xml fixed it for me. Thanks.

strk avatar May 23 '19 21:05 strk

(just to point out: the problem did not occur with php5, evidently the code paths are different there)

strk avatar May 23 '19 21:05 strk

I just had the same issue on php7.3 and Nextcloud 15.0.12. Installing php7.3-xml fixed it.

chaosgrid avatar Oct 02 '19 13:10 chaosgrid

I had the same issue on php7.0, ubuntu16.04 and Nextcloud 15.0.7. When running the update-script (/var/scripts/update.sh) of Nextcloud the issue occured. The following commands fixed it:

sudo add-apt-repository ppa:ondrej/php <-- caution, this adds the php-repo of Ondřej Surý to your system sudo apt-get update sudo apt-get install php7.2 mariadb-common php7.2-pgsql php7.2-xml php7.2-zip php7.2-mbstring php7.2-gd php7.2-curl sudo systemctl restart apache2

flostyen avatar Oct 21 '19 11:10 flostyen

Doing apt-get install --reinstall php7.2-xml worked for me. I guess the installation was corrupted?

lucgiffon avatar Jan 27 '20 07:01 lucgiffon

sudo -u www-data php7.3 occ db:convert-filecache-bigint --no-interaction If several php versions are installed, please select the correct php version.

JanisPlayer avatar May 11 '20 23:05 JanisPlayer

Same issue w php7.4

dhowe avatar Apr 09 '21 04:04 dhowe