is_link() function in php returns bogus results. Reproducible: Always Steps to Reproduce: 1. create a symlink 2. php script: test if its a link by is_link(), compare it to readlink() <?php $ln = "/var/www/localhost/htdocs/notglued/__md5.js"; echo "testning: ".$ln; clearstatcache(); echo "<br />is_link: ".is_link($ln); clearstatcache(); echo "<br />vardump(is_link): ".var_dump(is_link($ln)); clearstatcache(); echo "<br />readlink: ".readlink($ln); ?> outputs testning: /var/www/localhost/htdocs/notglued/__md5.js is_link: bool(false) vardump(is_link): readlink: /var/www/localhost/htdocs/notglued/md5.js the file tested really is a symlink: localhost ~ # ls -al /var/www/localhost/htdocs/notglued/*md5* lrwxrwxrwx 1 kurapica kurapica 55 Jun 9 20:27 /var/www/localhost/htdocs/notglued/__md5.js -> /var/www/localhost/htdocs/notglued/md5.js -rw-r--r-- 1 www www 8827 Jun 4 18:33 /var/www/localhost/htdocs/notglued/md5.js php is compiled as an apache2 module. php patched by the hardened-php patch. during testing i disabled the loaded extensions (suhosin, xcache, memcache). this is the top of the phpinfo() result: PHP Version 5.2.2-pl1-gentoo System Linux localhost 2.6.20-gentoo #5 SMP PREEMPT Tue Feb 6 00:03:18 CET 2007 x86_64 Build Date Jun 5 2007 17:53:05 Configure Command './configure' '--prefix=/usr/lib64/php5' '--host=x86_64-pc-linux-gnu' '--mandir=/usr/lib64/php5/man' '--infodir=/usr/lib64/php5/info' '--sysconfdir=/etc' '--cache-file=./config.cache' '--with-libdir=lib64' '--enable-maintainer-zts' '--disable-cli' '--with-apxs2=/usr/sbin/apxs2' '--with-config-file-path=/etc/php/apache2-php5' '--with-config-file-scan-dir=/etc/php/apache2-php5/ext-active' '--without-pear' '--enable-bcmath' '--with-bz2' '--enable-calendar' '--with-curl' '--with-curlwrappers' '--disable-dbase' '--enable-exif' '--without-fbsql' '--without-fdftk' '--disable-filter' '--enable-ftp' '--with-gettext' '--with-gmp' '--disable-json' '--with-kerberos=/usr' '--enable-mbstring' '--with-mcrypt' '--with-mhash' '--without-msql' '--without-mssql' '--with-ncurses' '--with-openssl' '--with-openssl-dir=/usr' '--enable-pcntl' '--disable-pdo' '--without-pgsql' '--disable-posix' '--with-pspell' '--without-recode' '--disable-simplexml' '--disable-shmop' '--without-snmp' '--disable-soap' '--enable-sockets' '--without-sybase' '--without-sybase-ct' '--disable-sysvmsg' '--disable-sysvsem' '--disable-sysvshm' '--with-tidy' '--disable-tokenizer' '--disable-wddx' '--disable-xmlreader' '--disable-xmlwriter' '--without-xmlrpc' '--with-xsl' '--enable-zip' '--with-zlib' '--disable-debug' '--enable-dba' '--without-cdb' '--with-db4' '--without-flatfile' '--without-gdbm' '--without-inifile' '--without-qdbm' '--with-freetype-dir=/usr' '--with-t1lib=/usr' '--enable-gd-jis-conv' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-gd' '--with-imap' '--with-imap-ssl' '--with-mysqli=/usr/bin/mysql_config' '--with-readline' '--without-libedit' '--without-mm' '--without-sqlite' Actual Results: see steps to reproduce
Looks just fine w/ php-5.2.4_pre200708051230-r2 $ ln -s test.php testlink $ php test.php testing: /tmp/testlink vardump(is_link): bool(true) readlink: test.php
confirming: Looks just fine w/ php-5.2.4_pre200708051230-r2
Thanks for reporting back.