473,395 Members | 1,692 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How does safe_mode_exec_dir work?

The manual (http://de3.php.net/manual/en/features.safe-mode.php) says
only this about safe_mode_exec_dir:
If PHP is used in safe mode, system() and the other functions
executing system programs refuse to start programs that are not in
this directory. You have to use / as directory separator on all
environments including Windows.
But what effect does this variable actually have - will this directory
automatically be the "local" directory for system calls?

For example, if it is set to /home/php-safe, and this directory contains
the program "helloworld.sh":

Will this work?
system("/home/php-safe/helloworld.sh");
And will this?
system("helloworld.sh");
Also, if the program is not in this directory, but in the parent
directory, will this be blocked as it should?
system("../helloworld.sh");
--
CB
Jan 31 '07 #1
3 5554
Christoph Burschka wrote:
The manual (http://de3.php.net/manual/en/features.safe-mode.php) says
only this about safe_mode_exec_dir:
If PHP is used in safe mode, system() and the other functions
executing system programs refuse to start programs that are not in
this directory. You have to use / as directory separator on all
environments including Windows.

But what effect does this variable actually have - will this directory
automatically be the "local" directory for system calls?

For example, if it is set to /home/php-safe, and this directory contains
the program "helloworld.sh":

Will this work?
system("/home/php-safe/helloworld.sh");

And will this?
system("helloworld.sh");

Also, if the program is not in this directory, but in the parent
directory, will this be blocked as it should?
system("../helloworld.sh");
I never used this myself, but I would guess system("/helloworld.sh"); would be
the right way to call the script.

Why not test?

--

//Aho
Jan 31 '07 #2
On Wed, 31 Jan 2007 03:40:08 -0800, Christoph Burschka
<ch****************@rwth-aachen.dewrote:
The manual (http://de3.php.net/manual/en/features.safe-mode.php) says
only this about safe_mode_exec_dir:
If PHP is used in safe mode, system() and the other functions
executing system programs refuse to start programs that are not in
this directory. You have to use / as directory separator on all
environments including Windows.

But what effect does this variable actually have - will this directory
automatically be the "local" directory for system calls?

For example, if it is set to /home/php-safe, and this directory contains
the program "helloworld.sh":

Will this work?
system("/home/php-safe/helloworld.sh");

And will this?
system("helloworld.sh");

Also, if the program is not in this directory, but in the parent
directory, will this be blocked as it should?
system("../helloworld.sh");
Safe mode is going to be removed, eventually. Why do you need it on?

--
Curtis, http://dyersweb.com
Feb 1 '07 #3
Curtis schrieb:
On Wed, 31 Jan 2007 03:40:08 -0800, Christoph Burschka
<ch****************@rwth-aachen.dewrote:
Safe mode is going to be removed, eventually. Why do you need it on?
I don't need it, my host does. ;)

And, strictly speaking, not *my* host either - privately, I have
everything I could wish for, self-compiled PHP 5.2.0, MySQL 5.1, shell
access and no safe mode in sight.

At work, I labour with PHP 4.4, MySQL 4.0, safe mode and WebDAV access
only. Go figure...

--
CB
Feb 1 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jonas | last post by:
This works fine in Win XP but does not work at all in Win 98. Private WithEvents objIExplorer As InternetExplorer I have to do it like this to get it to work in Win 98 Dim objIExplorer As...
0
by: Miguel Cardenas | last post by:
Hello list For some strange reason `mysql_config --...` does not work. If try something like gcc -o progname `mysql_config --cflags` progname.c `mysql_config --libs` (NOTE:...
4
by: rick | last post by:
The following basic script works fine in firefox by not in IE. Can anyone spot the problem? In IE I can only delete the first line but not the lines created by javascript. Also, look at the HTML...
15
by: Generic Usenet Account | last post by:
While I have a very good feel for how inlining works, I fail to see how in the world inlining can work if the inlined function is not described "in place" in a header file, but rather defined in a...
2
by: Harry Haller | last post by:
Why does the following work: // (1) Set new cookies setcookie ("font_type", $type_sel, time()+3600); setcookie ("font_size", $size_sel, time()+3600); // (1) Get most recent cookie $font_type =...
0
by: Jarod_24 | last post by:
How does tabindex work in ASP .net pages I dosen't seem to work quite like in regular forms. and there isn't any TabStop property either. 1 .How do you prevent a control form beign "tabbed"....
2
by: gsherp | last post by:
I can get the Onclick event handler to work when I added a new row using insertRow. It doesn't work in IE or in FF var cellarea = row.insertCell(2); cellarea.style.backgroundColor =...
2
by: DC | last post by:
Hi, why does this not work: <asp:ImageButton id="myButt" runat="server" OnCommand="myButt_kick" ImageUrl="<% =GetMyButtUrl() %>" </asp:ImageButton>
5
by: Pat | last post by:
Hi ASP Gurus, Please help me. Autocomplete works fine when the control does not have the focus when the page load. But when I put the focus on page load, then autocomplete does not work. I even...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.