Portrety Uliczne Nieznajomych - zobacz wyjątkową galerię portretów z warszawskich ulic
ZALOGUJ SIĘ
login:
hasło:
przypomnij hasło
załóż konto użytkownika
(i zobacz kilka porad gratis)
   
WYSZUKIWARKA I DZIAŁY
całe porady  tytuły
zaznacz działy do przeszukania
(brak wyboru = wszystkie działy)
PHP
MySQL >
PostgreSQL
SQLite
Perl
Java
XML
XSLT
XPath
WML
SVG
RegExp
Wyszukiwarki
Ochrona
VBScript
Google Plus
XHTML/CSS
JavaScript
Grafika
Flash
Photoshop
Windows
Linux
Bash
Apache
Procmail
E-biznes
Explorer
Opera
Firefox
Inne porady
   
KURSY, DOKUMENTACJE
Własne:
XHTML/CSS
JavaScript
ActionScript
WML, RSS, SSI
Pozostałe:
PHP
MySQL
Java API
więcej...
   
użytkowników online: 18
W CZYM MOGĘ POMÓC?


   
OPINIE UŻYTKOWNIKÓW
Gratulacje i dzięki! Trafiłem tu przypadkiem poszukując informacji na temat php+mysql. Wiele polskich stron powiela identyczne przykłady, klonuje te same kursy i lekcje... ten serwis okazał sie inny. Zasada "problem - rozwiazanie - wyjaśnienie" zdaje egzamin - zapewnia jasną, jednoznaczną i pewną pomoc w konkretnym przypadku. Porady są warte swojej ceny, przede wszystkim ze względu na przyjazną (także dla początkujących) formę i treść oraz bogate i stale powiększane zasoby. Polecam i pozdrawiam!

Kamil Dmowski
Polski Czerwony Krzyż

   
GALERIA FOTOGRAFII
   
PODRĘCZNIK PHP 5.x, 4.x, 3.x - częściowo spolszczony / źródło: www.php.net

[Spis] [A] [B] [C] [D] [E] [F] [G] [H] [I] [J] [K] [L] [M] [N] [O] [P] [Q] [R] [S] [T] [U] [V] [X] [W] [Z]

ini_set

(PHP 4, PHP 5)

ini_set -- Sets the value of a configuration option

Description

string ini_set ( string varname, string newvalue )

Sets the value of the given configuration option. Returns the old value on success, FALSE on failure. The configuration option will keep this new value during the script's execution, and will be restored at the script's ending.

Not all the available options can be changed using ini_set(). There is a list of all available options in the appendix.

See also: get_cfg_var(), ini_get(), ini_get_all(), and ini_restore()




User Contributed Notes

Ron Ludwig
10-Jan-2006 08:30

When your ISP does not allow you to add the default include directories - it might be useful to extend the 'include_path' variable:

<?  ini_set('include_path',ini_get('include_path').':../includes:');  ?>


Alan Hogan
07-Nov-2005 11:26

You can't use ini_set() to turn off register_globals.  They've already been registered.

But you can fake it.

<?php
// Effectively turn off dangerous register_globals without having to edit php.ini
if (ini_get(register_globals))  // If register_globals is enabled
{ // Unset $_GET keys
 
foreach ($_GET as $get_key => $get_value) {
   if (
ereg('^([a-zA-Z]|_){1}([a-zA-Z0-9]|_)*$', $get_key)) {
     eval(
"unset(\${$get_key});");
   }
  }
// Unset $_POST keys
 
foreach ($_POST as $post_key => $post_value) {
   if (
ereg('^([a-zA-Z]|_){1}([a-zA-Z0-9]|_)*$', $post_key)) {
     eval(
"unset(\${$post_key});");
   }
  }
// Unset $_REQUEST keys
 
foreach ($_REQUEST as $request_key => $request_value) {
   if (
ereg('^([a-zA-Z]|_){1}([a-zA-Z0-9]|_)*$', $request_key)) {
     eval(
"unset(\${$request_key});");
   }
  }
}
?>
(Based on work by Lazur)


simon at welsh dot co dot nz
06-Oct-2005 10:19

To have all errors reported, use
ini_set('error_reporting', E_ALL);
To have none of the errors reported(excludes major ones), use
ini_set('error_reporting', E_NONE);


David Jackson
20-Sep-2005 01:40

You can also find the Apache config files by useing command httpd -V


brainiac5 dot php at aimail dot de
05-Sep-2004 04:54

To find the apache php settings try something like this.
> cd /etc/apache2
> grep -r -n -i  safe_mode_exec_dir *.conf
or
> grep -r -n -i safe_mode.*On *.conf

If you find a gererated file, obviously you need to find the source template for it, to change what's needed there.

I just wasted a sunny Sunday on searching for where the heck safe_mode_exec_dir was changed.

And yes, Local Value in phpinfo does mean 'changed between the php.ini file and here', as you would think.

If you have an automated virtual host configuration, such as confixx, php ini values can be spread across very many files.

They can be changed in apache config files, that can have any name, but usually will end on .conf, besides in .htaccess files.


klw at gmx dot at
05-Sep-2004 03:49

To change settings from .htaccess files, it is also required that the directory permissions configured in Apache allow this.

The <Directory /foo/bar> entry in httpd.conf MUST contain "AllowOverride All" or at least "AllowOverride Options" to read PHP settings from the .htaccess file.

E.g. in Fedora Core 2, the default settings for /var/www/html/ are "AllowOverride None", so changing PHP settings via .htaccess for applications installed below /var/www/html/ will not work.


sean at php dot net
14-Aug-2004 03:54

While this doesn't belong in the manual, it should be useful for people looking on this page for zend_optimizer.* ini options, which are commonly installed:

Information on the "zend_optimizer.optimization_level" and "zend_optimizer.enable_loader" options is available at:

http://www.zend.com/support/user_docs/ZendOptimizer/PDF/ZendOptimizer_UserGuide.pdf


vincent(at)tigroux(dot)net
30-Apr-2004 03:20

Where you want set ini in .htaccess or vhosts directives, if the value of directive is boolean , use php_flag, else if the value is a string use php_value.

Ex : php_value include_path /home/user/include
php_flag zlib.output_compression On


davey at its-explosive dot net
18-Mar-2003 03:42

If you set something using php_admin_value in httpd.conf it is then not possible to be set the value at runtime, even if it's NOT PHP_INI_SYSTEM.

Just an interesting note for Server admins this might come in handy to disable setting of certain things... like allow_url_fopen.

- Davey


miroslav AT simunic DOT de
30-Sep-2002 05:26

If it

 

 
  © 1996-2012 & Reporter.plmiejscao serwisieabonamentwarunki korzystaniaRSSkontakt