# Too many levels of symbolic links error

- Thread: https://externals.io/message/46920
- Original archive: https://news-web.php.net/php.internals/46920
- Started by Bharat Nagwani on 2010-02-01T09:05:07+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #46920 — Bharat Nagwani — 2010-02-01T09:05:07+00:00

URL: https://externals.io/message/46920#46920

Hello,

We use php in cgi mode. PHP version is 5.2.3.

I am using popen to execute grep on a file

popen($cmd, "r");

where $cmd = "/usr/bin/grep xyz /var/tmp/log/session"

and log is a symbolic  link pointing to /var/log

ls -l /var/tmp/
lrwxr-xr-x  1 root    wheel    8 Jan 31 23:17 log -> /var/log

In the shell I am able to run this command fine.
When I execute from php using popen I get this error
[chrome://firebug/content/blank.gif]grep: /var/tmp/log/session: Too many levels of symbolic links

If I don't use symbolic link it works fine. But I need to use symbolic link
due to some limitations.

Any idea what could be wrong?

Thanks
