[owncloud-devel] php 32 bit (arm) filemtime issue

Boris Ribalkin ribalkin at gmail.com
Thu Sep 10 21:07:19 GMT 2015


Hi All,

I am facing an issue with running file:scan on arm:

filemtime(): stat failed

Looks like the reason is filemtime [1] is not working for files over 2G on
32 bit php [2]

Fixing function according to php website comment solved the problem:
  exec ('stat -c %Y '. escapeshellarg ($this->getSourcePath($path)));

I am sure that worked fine in past with older owncloud/php versions on the
same hardware.

Is there something I am missing or this never worked on php (32bit) / arm?
Or is it possible to have some if, like:

if (PHP_INT_SIZE === 4)
   return exec ('stat -c %Y '. escapeshellarg
($this->getSourcePath($path)));
else
   return filemtime($this->getSourcePath($path));


I cannot upgrade php to 64 bit on arm board as there there is no such thing
yet as arm64 or at least not popular enough on single board computers yet.

[1] http://php.net/manual/en/function.filemtime.php#68814
[2]
https://github.com/owncloud/core/blob/master/lib/private/files/storage/local.php#L159

My system:
ownCloud version 8.0.4
PHP Version => 5.6.9
System => Linux cubietruck 3.4.79-sun7i #13 SMP PREEMPT Thu Jul 3 06:34:55
CST 2014 armv7l
Configure Command =>  './configure'  '--enable-fpm' '--with-pgsql'
'--with-pdo-pgsql' '--enable-opcache' '--prefix'
'--with-config-file-path=/root/build/install/config' '--with-gd'
'--enable-zip' '--with-zlib' '--with-curl' '--with-readline' '--with-ldap'
'--with-ldap-sasl' '--with-libdir=lib/arm-linux-gnueabihf'
'--enable-mbstring'

Thank you

-- 
Boris Rybalkin
ribalkin at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.owncloud.org/pipermail/devel/attachments/20150910/3e71726f/attachment.html>


More information about the Devel mailing list