Customizing PHP Safe Mode Published: Aug 26, 2004
  • Rating

    5/5

Pico is a simple, display-oriented text editor based on the Pine message system composer. A must have tool for every admin.

Pico is a simple, display-oriented text editor based on the Pine message system composer. As with Pine, commands are displayed at the bottom of the screen, and context-sensitive help is provided. As characters are typed they are immediately inserted into the text.
Editing commands are entered using control-key combinations. As a work-around for communications programs that swallow certain control characters, you can emulate a control key by pressing ESCAPE twice, followed by the desired control character, e.g. "ESC ESC c" would be equivalent to entering a ctrl-c. The editor has five basic features: paragraph justification, searching, block cut/paste, a spelling checker, and a file browser.


Installing Pico

Login to SSH as root.

Sometimes, direct root login is disabled. If it is disabled do the following:

# su -
# password: [Enter your WHM root pass]
# [Hostname]: [Ready to work ]

To Download ports:
# /stand/sysinstall
- Go to Configure (post install)
- Go to Distributions
- Select 'ports'
- Select 'ok'
From there select FTP transfer (ftp.freebsd.org is ok) and it should download the ports into /usr/ports. When it's done, just exist sysinstall and run the commands I stated earlier.

It'll take a while to download.

after its finished downloading, do this:

# cd /usr/ports/editors/pico
# make install

This will install Pico for you, then you are finished!

Pico Commands

Options
+n
Causes pico to be started with the cursor located n lines into the file. (Note: no space between "+" sign and number)
-a
Display all files including those beginning with a period (.).
-b
Enable the option to Replace text matches found using the "Where is" command.
-d
Rebind the "delete" key so the character the cursor is on is rubbed out rather than the character to its left.
-e
Enable file name completion.
-f
Use function keys for commands. This option supported only in conjunction with UW Enhanced NCSA telnet.
-h
List valid command line options.
-j
Enable "Goto" command in the file browser. This enables the command to permit explicitly telling pilot which directory to visit.
-g
Enable "Show Cursor" mode in file browser. Cause cursor to be positioned before the current selection rather than placed at the lower left of the display.
-k
Causes "Cut Text" command to remove characters from the cursor position to the end of the line rather than remove the entire line.
-m
Enable mouse functionality. This only works when pico is run from within an X Window System "xterm" window.
-nn
The -nn option enables new mail notification. The n argument is optional, and specifies how often, in seconds, your mailbox is checked for new mail. For example, -n60 causes pico to check for new mail once every minute. The default interval is 180 seconds, while the minimum allowed is 30. (Note: no space between "n" and the number)
-o  dir
Sets operating directory. Only files within this directory are accessible. Likewise, the file browser is limited to the specified directory subtree.
-rn
Sets column used to limit the "Justify" command's right margin
-s  speller
Specify an alternate program spell to use when spell checking.
-t
Enable "tool" mode. Intended for when pico is used as the editor within other tools (e.g., Elm, Pnews). Pico will not prompt for save on exit, and will not rename the buffer during the "Write Out" command.
-v
View the file only, disallowing any editing.
-version
Print Pico version and exit.
-w
Disable word wrap (thus allow editing of long lines).
-x
Disable keymenu at the bottom of the screen.
-z
Enable ^Z suspension of pico.
-q
Termcap or terminfo definition for input escape sequences are used in preference to sequences defined by default. This option is only available if pico was compiled with the TERMCAP_WINS define turned on.

Written by: Ibrahim Ezzy (ibrahim.Ezzy@Searchxs.com) and allera.

 

  • Rating

    5/5

Related Articles

Comments (12)

  • Gravatar - MooDa
    MooDa 18:29, January 16, 2006
    now when i activate safe mode some functions do not work successfully in my code like chmode for directory and copy function<br />
    how i can solve these problems?<br />
    answer me on my mail
  • Gravatar - coolkid
    coolkid 15:00, April 13, 2007
    http://www.webhostgear.com/phpinfo.phps<br />
    this link is not working. Plz, change it
  • Gravatar - wt
    wt 10:26, May 24, 2007
    a most-simply-made phpinfo() script could be:<br />
    <?php<br />
    phpinfo();<br />
    ?> <br />
    you can put these lines as phpinfo.php to your server.
  • Gravatar - Sharda
    Sharda 07:59, June 4, 2007
    hello, i want to turn on the register_globals flag in the /usr/local/Zend/etc/php.ini file, but not able to do that.<br />
    <br />
    please guide me.<br />
    <br />
    ur way of describing the process is excellent.
  • Gravatar - ahmad
    ahmad 20:06, August 24, 2007
    hello <br />
    how are you <br />
    >>>>>>>>>>>>>><br />
    i have free account in hyperphp.com and i should turn off php safe mode because i want install flash chat on >>> can i make it off ???<br />
    >>>>>>>>>>>>>>>>>>>>
  • Gravatar - Ahmed
    Ahmed 16:56, February 21, 2008
    I think this is an old article cause I tried it on Apache 2.2 and it doesn't work with me :(<br />
  • Gravatar - Tester
    Tester 16:01, April 3, 2008
    View all script variables may be<br />
    <?php<br />
    echo '<pre>';<br />
    print_r(get_defined_vars());<br />
    echo '</pre>';<br />
    ?>
  • Gravatar - Mick
    Mick 19:02, May 13, 2008
    PHP's safe_mode is a flawed system and will not be availble in PHP6. Secure your code first time, every time. Thats my two cents. Enjoy your false sense of security whilst you can.
  • Gravatar - dee
    dee 15:00, August 22, 2008
    Hi. I have a account with big company that own the server. Is possible to turn the save-mode off for my website? Tried to locate php.ini but couldn't find it.
  • Gravatar - Isaac Flores
    Isaac Flores 22:30, July 26, 2010
    Great post!
    thank you very much :)
  • Gravatar - Nabil L.
    Nabil L. 18:42, March 11, 2011
    Should we (shared host users) wait for PHP6?
    Or move to dedicated host? Still expensive yet...

Add Your Thoughts

WebHostGear.com is a hosting directory, not a web host.

Copyright © 1998-2014 WebHostGear.com