Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

dev-lang/php USE flag to enable php's glob() ?

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
1 post • Page 1 of 1
Author
Message
mieses
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 110
Joined: Sat Feb 28, 2004 11:36 pm

dev-lang/php USE flag to enable php's glob() ?

  • Quote

Post by mieses » Thu May 06, 2010 5:54 pm

I don't know if this is the right place to ask a question about dev-lang/php.

PHP's glob() function returns an empty array when called in a web page but works when called from command line. Is there a USE flag to allow PHP's glob() function access to the filesystem (or to libc)?

The following php code returns an empty array:

Code: Select all

<?php
print_r(glob("/var/www/localhost/htdocs/*"));
?>
while the following shell command correctly returns an array of filenames and directories:

Code: Select all

# sudo -u apache php -c /etc/php/apache2-php5/php.ini -r 'print_r(glob("/var/www/localhost/htdocs/*"));'
Note that I am trying to force command line php to use the same php.ini as apache uses, for sake of consistency.

My phpinfo() does not indicate that any functions are disabled. I don't think php is running in "safe mode". I see the same behavior in dev-lang/php-5.2.12 and 5.2.13, on x86 and amd64. The scandir() function is able to access the filesystem when called from a web page.

php 5.2.13 is compiled with the following USE flags:

Code: Select all

apache2 berkdb bzip2 cli crypt ctype gdbm hash iconv imap ipv6 json ldap mysql mysqli ncurses nls pcre pdo readline reflection session simplexml snmp sockets spl ssl threads truetype unicode xml xmlrpc xsl zlib -adabas -bcmath -birdstep -calendar -cdb -cgi -cjk -concurrentmodphp -curl -curlwrappers -db2 -dbase -dbmaker -debug -discard-path -doc -empress -empress-bcs -esoob -exif -fastbuild -fdftk -filter -firebird -flatfile -force-cgi-redirect -frontbase -ftp -gd -gd-external -gmp -inifile -interbase -iodbc -java-external -kerberos -kolab -ldap-sasl -libedit -mcve -mhash -msql -mssql -oci8 -oci8-instant-client -odbc -pcntl -pic -posix -postgres -qdbm -recode -sapdb -sharedext -sharedmem -soap -solid -spell -sqlite -suhosin -sybase -sybase-ct -sysvipc -tidy -tokenizer -wddx -xmlreader -xmlwriter -xpm -yaz -zip
This issue is similar to http://bugs.php.net/bug.php?id=48365 except that in my case glob() does work from command line. Is there a USE flag that affects the behavior of php's glob()?
Top
Post Reply
1 post • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic