# Filename of the currently executed php script

- Thread: https://externals.io/message/9872
- Original archive: https://news-web.php.net/php.internals/9872
- Started by Stefan Mueller on 2004-05-16T14:22:16+00:00
- Messages: 2
- 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

---

## #9872 — Stefan Mueller — 2004-05-16T14:22:16+00:00

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

Hi

I'm a greenhorn tying to add some code to /ext/standard/mail.c php_mail(...), 
but I have trouble to get the filename of the php script that triggers the 
php_mail(...) call. compiler_globals.compiled_filename doesn't work. It's 
always NULL.
Any ideas how i could get this filename?

thanks !

Stefan

---

## #9873 — Wez Furlong — 2004-05-16T14:36:19+00:00

URL: https://externals.io/message/9872#9873 · In reply to: #9872

>From zend_error():

  error_filename = zend_get_executed_filename(TSRMLS_C);
  error_lineno = zend_get_executed_lineno(TSRMLS_C); 

--Wez.

> -----Original Message-----
> From: Stefan Mueller [mailto:phplist@s-mueller.ch] 
> Sent: 16 May 2004 15:22
> To: internals@lists.php.net
> Subject: [PHP-DEV] Filename of the currently executed php script
> 
> Hi
> 
> I'm a greenhorn tying to add some code to 
> /ext/standard/mail.c php_mail(...), 
> but I have trouble to get the filename of the php script that 
> triggers the 
> php_mail(...) call. compiler_globals.compiled_filename 
> doesn't work. It's 
> always NULL.
> Any ideas how i could get this filename?
> 
> thanks !
> 
> Stefan
