PHP fread() PHP error

Nextcloud version 13.0.0
Operating system and version CentOs7 Linux 3.10.0-693.17.1.el7.x86_64
Apache or nginx version _Apache 2.4.6
PHP version _7.1.14

The issue you are facing:

Error PHP fread(): file created in the system’s temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297 2018-02-19T09:13:14+0100

Is this the first time you’ve seen this error? (Y/N): yes

Steps to replicate it:

  1. I dunno :frowning:

The output of your Nextcloud log in Admin > Logging:

|Error|PHP|imagettfbbox(): Could not read font at /var/www/html/nextcloud/lib/private/Avatar.php#260|2018-02-19T13:48:41+0100|
|---|---|---|---|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:15+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:15+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:15+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:14+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:14+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:13+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:12+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:12+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:12+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:11+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:11+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:10+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:10+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:10+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:09+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:09+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:09+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:08+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:08+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:08+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:07+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:07+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:07+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:06+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:06+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:05+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:05+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:04+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:04+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:04+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:03+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:03+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:03+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:03+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:02+0100|
|Error|PHP|fread(): file created in the system's temporary directory at /var/www/html/nextcloud/lib/private/legacy/helper.php#297|2018-02-19T09:17:02+0100|

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' =>
  array (
    0 => '
    1 => '
  ),
  'datadirectory' => '/mnt/clouddata/data',
  'overwrite.cli.url' => 
  'dbtype' => 'mysql',
  'version' => '13.0.0.14',
  'dbname' => 
  'dbhost' => 
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'ncuser',
  'dbpassword' => 
  'installed' => true,
  'htaccess.RewriteBase' => '/',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => 'localhost',
    'port' => 6379,
  ),
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtphost' => '',
  'mail_smtpport' => '',
  'mail_from_address' => '',
  'mail_domain' => '.com',
  'mail_smtpname' => '-',
  'mail_smtppassword' => '',
  'mail_smtpsecure' => '',
  'loglevel' => 3,
  'maintenance' => false,
  'onlyoffice' =>
  array (
    'verify_peer_off' => true,
  ),
  'theme' => '',
);

The output of your Apache/nginx/system log in /var/log/____:

httpd error log

[Sun Feb 18 03:48:02.425850 2018] [auth_digest:notice] [pid 1154] AH01757: generating secret for digest authentication ...
[Sun Feb 18 03:48:02.441551 2018] [lbmethod_heartbeat:notice] [pid 1154] AH02282: No slotmem from mod_heartmonitor
[Sun Feb 18 03:48:02.573900 2018] [mpm_prefork:notice] [pid 1154] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.1.14 configured -- resuming normal operations
[Sun Feb 18 03:48:02.573933 2018] [core:notice] [pid 1154] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Mon Feb 19 08:36:24.622564 2018] [mpm_prefork:notice] [pid 1154] AH00170: caught SIGWINCH, shutting down gracefully
[Mon Feb 19 08:36:45.087835 2018] [core:notice] [pid 65126] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Mon Feb 19 08:36:45.109761 2018] [suexec:notice] [pid 65126] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Feb 19 08:36:45.172291 2018] [alias:warn] [pid 65126] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 18 will probably never match because it overlaps an earlier Alias.
[Mon Feb 19 08:36:45.172318 2018] [alias:warn] [pid 65126] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 19 will probably never match because it overlaps an earlier Alias.
[Mon Feb 19 08:36:45.172324 2018] [alias:warn] [pid 65126] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 20 will probably never match because it overlaps an earlier Alias.
[Mon Feb 19 08:36:45.172330 2018] [alias:warn] [pid 65126] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 21 will probably never match because it overlaps an earlier Alias.
[Mon Feb 19 08:36:45.172335 2018] [alias:warn] [pid 65126] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 22 will probably never match because it overlaps an earlier Alias.
[Mon Feb 19 08:36:45.173192 2018] [auth_digest:notice] [pid 65126] AH01757: generating secret for digest authentication ...
[Mon Feb 19 08:36:45.174801 2018] [lbmethod_heartbeat:notice] [pid 65126] AH02282: No slotmem from mod_heartmonitor
[Mon Feb 19 08:36:45.307129 2018] [mpm_prefork:notice] [pid 65126] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.1.14 configured -- resuming normal operations
[Mon Feb 19 08:36:45.307191 2018] [core:notice] [pid 65126] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Mon Feb 19 08:40:49.528921 2018] [mpm_prefork:notice] [pid 65126] AH00170: caught SIGWINCH, shutting down gracefully
[Mon Feb 19 08:40:51.294557 2018] [core:notice] [pid 3888] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Mon Feb 19 08:40:51.296442 2018] [suexec:notice] [pid 3888] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Feb 19 08:40:51.349702 2018] [alias:warn] [pid 3888] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 18 will probably never match because it overlaps an earlier Alias.
[Mon Feb 19 08:40:51.349736 2018] [alias:warn] [pid 3888] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 19 will probably never match because it overlaps an earlier Alias.
[Mon Feb 19 08:40:51.349742 2018] [alias:warn] [pid 3888] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 20 will probably never match because it overlaps an earlier Alias.
[Mon Feb 19 08:40:51.349748 2018] [alias:warn] [pid 3888] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 21 will probably never match because it overlaps an earlier Alias.
[Mon Feb 19 08:40:51.349753 2018] [alias:warn] [pid 3888] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 22 will probably never match because it overlaps an earlier Alias.
[Mon Feb 19 08:40:51.350649 2018] [auth_digest:notice] [pid 3888] AH01757: generating secret for digest authentication ...
[Mon Feb 19 08:40:51.352425 2018] [lbmethod_heartbeat:notice] [pid 3888] AH02282: No slotmem from mod_heartmonitor
[Mon Feb 19 08:40:51.667322 2018] [mpm_prefork:notice] [pid 3888] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.1.14 configured -- resuming normal operations
[Mon Feb 19 08:40:51.667397 2018] [core:notice] [pid 3888] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Mon Feb 19 08:42:36.618870 2018] [mpm_prefork:notice] [pid 3888] AH00170: caught SIGWINCH, shutting down gracefully
[Mon Feb 19 08:42:37.764340 2018] [core:notice] [pid 5220] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Mon Feb 19 08:42:37.766233 2018] [suexec:notice] [pid 5220] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Feb 19 08:42:37.819005 2018] [alias:warn] [pid 5220] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 18 will probably never match because it overlaps an earlier Alias.
[Mon Feb 19 08:42:37.819036 2018] [alias:warn] [pid 5220] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 19 will probably never match because it overlaps an earlier Alias.
[Mon Feb 19 08:42:37.819043 2018] [alias:warn] [pid 5220] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 20 will probably never match because it overlaps an earlier Alias.
[Mon Feb 19 08:42:37.819049 2018] [alias:warn] [pid 5220] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 21 will probably never match because it overlaps an earlier Alias.
[Mon Feb 19 08:42:37.819054 2018] [alias:warn] [pid 5220] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 22 will probably never match because it overlaps an earlier Alias.
[Mon Feb 19 08:42:37.819935 2018] [auth_digest:notice] [pid 5220] AH01757: generating secret for digest authentication ...
[Mon Feb 19 08:42:37.821656 2018] [lbmethod_heartbeat:notice] [pid 5220] AH02282: No slotmem from mod_heartmonitor
[Mon Feb 19 08:42:37.956653 2018] [mpm_prefork:notice] [pid 5220] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.1.14 configured -- resuming normal operations
[Mon Feb 19 08:42:37.956711 2018] [core:notice] [pid 5220] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Mon Feb 19 08:43:34.014379 2018] [mpm_prefork:notice] [pid 5220] AH00170: caught SIGWINCH, shutting down gracefully
[Mon Feb 19 08:43:37.156365 2018] [core:notice] [pid 5810] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Mon Feb 19 08:43:37.158442 2018] [suexec:notice] [pid 5810] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Feb 19 08:43:37.210421 2018] [alias:warn] [pid 5810] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 18 will probably never match because it overlaps an earlier Alias.
[Mon Feb 19 08:43:37.210447 2018] [alias:warn] [pid 5810] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 19 will probably never match because it overlaps an earlier Alias.
[Mon Feb 19 08:43:37.210452 2018] [alias:warn] [pid 5810] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 20 will probably never match because it overlaps an earlier Alias.
[Mon Feb 19 08:43:37.210458 2018] [alias:warn] [pid 5810] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 21 will probably never match because it overlaps an earlier Alias.
[Mon Feb 19 08:43:37.210463 2018] [alias:warn] [pid 5810] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 22 will probably never match because it overlaps an earlier Alias.
[Mon Feb 19 08:43:37.211272 2018] [auth_digest:notice] [pid 5810] AH01757: generating secret for digest authentication ...
[Mon Feb 19 08:43:37.212800 2018] [lbmethod_heartbeat:notice] [pid 5810] AH02282: No slotmem from mod_heartmonitor
[Mon Feb 19 08:43:37.346475 2018] [mpm_prefork:notice] [pid 5810] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.1.14 configured -- resuming normal operations
[Mon Feb 19 08:43:37.346550 2018] [core:notice] [pid 5810] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Mon Feb 19 09:07:42.299751 2018] [mpm_prefork:notice] [pid 5810] AH00170: caught SIGWINCH, shutting down gracefully
[Mon Feb 19 09:10:05.899753 2018] [core:notice] [pid 1175] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Mon Feb 19 09:10:05.985594 2018] [suexec:notice] [pid 1175] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Feb 19 09:10:06.107770 2018] [alias:warn] [pid 1175] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 18 will probably never match because it overlaps an earlier Alias.
[Mon Feb 19 09:10:06.107800 2018] [alias:warn] [pid 1175] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 19 will probably never match because it overlaps an earlier Alias.
[Mon Feb 19 09:10:06.107807 2018] [alias:warn] [pid 1175] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 20 will probably never match because it overlaps an earlier Alias.
[Mon Feb 19 09:10:06.107812 2018] [alias:warn] [pid 1175] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 21 will probably never match because it overlaps an earlier Alias.
[Mon Feb 19 09:10:06.107818 2018] [alias:warn] [pid 1175] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 22 will probably never match because it overlaps an earlier Alias.
[Mon Feb 19 09:10:06.109340 2018] [auth_digest:notice] [pid 1175] AH01757: generating secret for digest authentication ...
[Mon Feb 19 09:10:06.111540 2018] [lbmethod_heartbeat:notice] [pid 1175] AH02282: No slotmem from mod_heartmonitor
[Mon Feb 19 09:10:21.019604 2018] [mpm_prefork:notice] [pid 1175] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.1.14 configured -- resuming normal operations
[Mon Feb 19 09:10:21.019668 2018] [core:notice] [pid 1175] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Tue Feb 20 03:40:03.476346 2018] [mpm_prefork:notice] [pid 1175] AH00171: Graceful restart requested, doing restart
[Tue Feb 20 03:40:03.605115 2018] [alias:warn] [pid 1175] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 18 will probably never match because it overlaps an earlier Alias.
[Tue Feb 20 03:40:03.605145 2018] [alias:warn] [pid 1175] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 19 will probably never match because it overlaps an earlier Alias.
[Tue Feb 20 03:40:03.605152 2018] [alias:warn] [pid 1175] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 20 will probably never match because it overlaps an earlier Alias.
[Tue Feb 20 03:40:03.605158 2018] [alias:warn] [pid 1175] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 21 will probably never match because it overlaps an earlier Alias.
[Tue Feb 20 03:40:03.605163 2018] [alias:warn] [pid 1175] AH00671: The Alias directive in /etc/httpd/conf.d/welcome.conf at line 22 will probably never match because it overlaps an earlier Alias.
[Tue Feb 20 03:40:03.617141 2018] [auth_digest:notice] [pid 1175] AH01757: generating secret for digest authentication ...
[Tue Feb 20 03:40:03.647363 2018] [lbmethod_heartbeat:notice] [pid 1175] AH02282: No slotmem from mod_heartmonitor
[Tue Feb 20 03:40:03.820877 2018] [mpm_prefork:notice] [pid 1175] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.1.14 configured -- resuming normal operations
[Tue Feb 20 03:40:03.820908 2018] [core:notice] [pid 1175] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

Hi,

I’m not hundred percent sure, but it sounds like a permission (access) problem to me.
Could you check if you set the correct permissions on all Nextcloud (sub) folders and the same for the data folder. Furthermore please check what temporary folders are defined in your php.ini and make sure they are accessible by the user your web server runs with.

Looks like you use SELinux. Did you just configure it and your server worked before? Does your server work with disabled SELinux?
What have you done right before the server stopped working?

1 Like

SELinux -.-
After running semanage and restorecon a second time - the error is gone… it’s magic

thanks for your input

1 Like