BLU Discuss list archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Discuss] php question. change directory to executing script.
- Subject: [Discuss] php question. change directory to executing script.
- From: sillystring at protonmail.com (Eric Chadbourne)
- Date: Mon, 18 Dec 2017 11:39:46 -0500
Hi All, I have a little function that needs to delete some files. I don't want it to delete them from the directory of my user, but in the directory of the script. For example from terminal: cd $HOME php /path/to/script/foo.php // will execute foo in home But I want it to execute foo in /script. So in the function I told it to change working directory to script path. chdir(dirname(__FILE__)); Am I missing something or is this OK? Is it evil to do such a thing? Thanks, Eric Chadbourne
- Follow-Ups:
- [Discuss] php question. change directory to executing script.
- From: smallm at sdf.org (Mike Small)
- [Discuss] php question. change directory to executing script.
- Prev by Date: [Discuss] AD/LDAP authentication
- Next by Date: [Discuss] php question. change directory to executing script.
- Previous by thread: [Discuss] Boston Linux Meeting Wednesday, December 20, 2017 - Scale preview
- Next by thread: [Discuss] php question. change directory to executing script.
- Index(es):