text
stringlengths 1
254
| output
stringlengths 2
255
|
---|---|
To use shared memory allocation (mm) for session storage configure PHP --with-mm[=DIR].
|
PHPã®ã»ãã·ã§ã³ãµããŒãã¯ããã©ã«ãã§æå¹ãšãªã£ãŠããŸã ã»ãã·ã§ã³ãµããŒããæå¹ã«ããŠPHPãæ§ç¯ããããªãå Žåã«ã¯ã configureã«ãªãã·ã§ã³ --disable-session ãæå®ããå¿
èŠããããŸãã ã»ãã·ã§ã³èšæ¶é åãšããŠå
±æã¡ã¢ãª(mm)ã䜿çšããã«ã¯ãPHPã®configure ã« --with-mm[=DIR] ãæå®ããŸãã
|
You do not need to load any additional extension in order to use these functions.
|
Windowsçã® PHP ã«ã¯ãã®æ¡åŒµã¢ãžã¥ãŒã«ã®ãµããŒããçµã¿èŸŒãŸããŠããŸãããããã®é¢æ°ã䜿çšããããã«æ¡åŒµã¢ãžã¥ãŒã«ã远å ã§ããŒãããå¿
èŠã¯ãããŸããã
|
Table 1.
|
ãããã®é¢æ°ã®åäœã¯ã php.ini ã®èšå®ã«ããå€åããŸãã
|
"a=href,area=href,frame=src,input=src,form=fakeentry"
|
衚 1ã»ãã·ã§ã³ã®èšå®ãªãã·ã§ã³
|
We will give a short overview.
|
ã»ãã·ã§ã³ç®¡çã·ã¹ãã ã¯ã php.ini ãã¡ã€ã«ã«èšè¿°å¯èœãªå€ãã®èšå®ãª ãã·ã§ã³ããµããŒãããŸãã以äžã«æŠèŠã瀺ããŸãã
|
Defaults to files.
|
session.save_handler ã¯ãã»ãã·ã§ã³ã«é¢é£ã ãããŒã¿ã®ä¿åããã³ååŸã«äœ¿çšããããã³ãã«åãå®çŸ©ããŸããã ãã©ã«ãã¯ã files ã§ãã session_set_save_handler() ãåç
§ããŠäžããã
|
If you choose the default files handler, this is the path where the files are created.
|
session.save_path ã¯ãä¿åãã³ãã©ã«æž¡ããã åŒæ°ãå®çŸ©ããŸããããã©ã«ãã®ãã¡ã€ã«ãã³ãã©ãéžæããå Žåã ãã¡ã€ã«ãäœæãããå Žæã®ãã¹ã«ãªããŸããããã©ã«ãã¯ã /tmp ã§ãã session.save_path ã®ãã¹ã®æ·±ãã2ãã倧ããå Ž åãã¬ãŒãããžã³ã¬ã¯ã·ã§ã³ã¯è¡ãããŸããã session_save_path() ãåç
§ããŠäžããã
|
If you leave this set to a world-readable directory, such as / tmp (the default), other users on the server may be able to hijack sessions by getting the list of files in that directory.
|
ãã®èšå®ã /tmp (ããã©ã«ã)ã®ããã«ã©ãã ãã§ãèªã¿èŸŒã¿å¯èœãªãã£ã¬ã¯ããªã®ãŸãŸã«ããŠããå ŽåããµãŒãäž ã®ä»ã®ãŠãŒã¶ããã®ãã£ã¬ã¯ããªã®ãã¡ã€ã«ã®ãªã¹ããååŸããããš ã«ãããã»ãã·ã§ã³ããã€ãžã£ãã¯ãããããšãå¯èœãšãªããŸãã
|
Make sure to specify a valid path, e.g.: c: / temp.
|
泚æ WindowsãŠãŒã¶ãPHPã®session颿°ã䜿çšããããã«ã¯ããã®å€æ°ãå€ æŽããå¿
èŠããããŸãã c:/temp ã®ãããªæå¹ ãªãã¹ãæå®ããããã«ããŠäžããã
|
It should only contain alphanumeric characters.
|
session.name ã¯ã»ãã·ã§ã³åãæå®ãã ã¯ãããŒåãšããŠäœ¿çšãããŸãã ã¢ã«ãã¡ãããæåã®ã¿ã§æå®ããå¿
èŠããããŸãã ããã©ã«ãã¯ã PHPSESSID ã§ãã session_name() ãåç
§ããŠäžããã
|
Defaults to 0 (disabled).
|
session.auto_start ã¯ãªã¯ãšã¹ãéå§æã« ã»ãã·ã§ã³ã¢ãžã¥ãŒã«ãã»ãã·ã§ã³ãèªåçã«éå§ãããã©ããã æå®ããŸããããã©ã«ãã¯ã 0 (ç¡å¹)ã§ãã
|
Currently, a PHP internal format (name php) and WDDX is supported (name wddx).
|
session.serialize_handler ã¯ãã·ãªã¢ã«åãŸã ã¯ã·ãªã¢ã«åããŒã¿ã埩å
ããããã«äœ¿çšããããã³ãã©ã®ååãå® çŸ©ããŸããçŸåšã( php ãšããååã®)PHP å
éš ãã©ãŒãããããã³( wddx ãšããååã®)WDDX ã ãµããŒããããŠããŸããWDDXã¯ãPHP ã WDDX ãµããŒã ãæå¹ã«ããŠã³ã³ãã€ã« ãããŠããå Žåã®ã¿äœ¿çšå¯èœã§ããããã©ã«ãã¯ã php ã§ãã
|
session.gc_probability specifies the probability that the gc (garbage collection) routine is started on each request in percent.
|
session.gc_probability ã¯ãgc (ã¬ãŒãããžã» ã³ã¬ã¯ã·ã§ã³)ã«ãŒãã³ãåãªã¯ãšã¹ãã«ãããŠéå§ããã確çãã㌠ã»ã³ãã§æå®ããŸããããã©ã«ãã¯ã 1 ã§ãã
|
session.gc_maxlifetime specifies the number of seconds after which data will be seen as' garbage 'and cleaned up.
|
session.gc_maxlifetime ã¯ãããŒã¿ã'ãã¿'ãš ã¿ãªãããŠããæ¶å»ããããŸã§ã®ç§æ°ãæå®ããŸãã
|
Windows FAT does not so you will have to come up with another way to handle garbage collecting your session if you are stuck with a FAT filesystem or any other fs where atime tracking is not available.
|
泚æ ããã©ã«ãã®ãã¡ã€ã«ã«åºã¥ãã»ãã·ã§ã³ãã³ãã©ã䜿çšããŠããå Ž åã䜿çšãããã¡ã€ã«ã·ã¹ãã ã¯ãã¢ã¯ã»ã¹æé(atime)ãèšé²ã§ãã å¿
èŠããããŸããWindows FATã¯ãããã§ããªãããã FATãã¡ã€ã«ã·ã¹ãã ãŸãã¯atimeã®èšé²ãã§ããªãä»ã®ãã¡ã€ã«ã·ã¹ ãã ã§åé¡ãçºçããå Žåã¯ãã»ãã·ã§ã³ã®ã¬ããŒãžã³ã¬ã¯ãåŠçã è¡ãä»ã®ææ®µãçšæããå¿
èŠããããŸãã
|
If the Referer was sent by the client and the substring was not found, the embedded session id will be marked as invalid.
|
session.referer_check ã«ã¯ãHTTP Referer ã« ãããŠç¢ºèªãè¡ãæååãæå®ããŸããRefererãã¯ã©ã€ã¢ã³ãã«ãã éä¿¡ãããŠããããã€ãæå®ããæååãèŠä»ãããªãå Žåãåã蟌 ãŸããã»ãã·ã§ã³IDã¯ç¡å¹ãšãªããŸããããã©ã«ãã¯ç©ºã®æååã§ãã
|
Examples are / dev / random or / dev / urandom which are available on many Unix systems.
|
session.entropy_file ã¯ã ã»ãã·ã§ã³IDãäœæããéã®å¥ã®ãšã³ããããœãŒã¹ãšããŠäœ¿çšãã å€éšãªãœãŒã¹ãžã®ãã¹ãæå®ããŸãã äŸãšããŠã¯ãå€ãã® UNIX ã§å©çšå¯èœãª /dev/random ãŸã㯠/dev/urandom ããããããŸãã
|
Defaults to 0 (disabled).
|
session.entropy_length ã¯ãåèšã®ãã¡ã€ã«ãã èªã¿ãããã€ãæ°ãæå®ããŸããããã©ã«ãã¯ã 0 (ç¡å¹)ã§ãã
|
Defaults to 1 (enabled).
|
session.use_cookies ã«ããã¯ã©ã€ã¢ã³ãåŽã«ã»ã ã·ã§ã³IDãä¿åããéã«ã¯ãããŒã䜿çšãããã©ãããæå®ããŸããã ãã©ã«ã㯠1 (æå¹)ã§ãã
|
Defaults to 0 (disabled, for backward compatibility).
|
session.use_only_cookies ã¯ã ãã®ã¢ãžã¥ãŒã«ãã¯ã©ã€ã¢ã³ãåŽãžã®ã»ãã·ã§ã³IDã®ä¿åã« Cookie ã®ã¿ ã䜿çšããããšãæ å®ããŸããããã©ã«ãã¯ã 0 (ç¡å¹ãäžäœäºææ§ã® ãã)ã§ãããã®èšå®ãæå¹ã«ããããšã«ãããã»ãã·ã§ã³IDãURLã«å ãèŸŒãæ»æãé²ãããšãã§ããŸãããã®èšå®ã¯ã PHP 4.3.0ã§è¿œå ãããŸããã
|
session.cookie_lifetime specifies the lifetime of the cookie in seconds which is sent to the browser.
|
session.cookie_lifetime ã¯ããã©ãŠã¶ã«éä¿¡ã ãã¯ãããŒã®æå¹æéãç§åäœã§æå®ããŸããå€0ã¯ã"ãã©ãŠã¶ãéã ããŸã§"ãæå³ããŸããããã©ã«ãã¯ã 0 ã§ãã session_get_cookie_params() ããã³ session_set_cookie_params() ãåç
§ããŠäžããã
|
session.cookie_path session.cookie_path specifies path to set in session_cookie.
|
session.cookie_path ã«ããsession_cokkieã§èš å®ãããã¹ãæå®ããŸããããã©ã«ã㯠/ ã§ãã session_get_cookie_params() ããã³ session_set_cookie_params() ãåç
§ããŠäžããã
|
session.cookie_domain specifies the domain to set in session_cookie.
|
session.cookie_domain ã«ããsession_cookieã§ æå®ãããã¡ã€ã³ãæå®ããŸããããã©ã«ãã§ã¯æå®ãããŸããã session_get_cookie_params() ããã³ session_set_cookie_params() ãåç
§ããŠäžããã
|
session.cookie_secure specifies whether cookies should only be sent over secure connections.
|
session.cookie_secure ã¯ã ã»ãã¥ã¢ãªæ¥ç¶ãéããŠã®ã¿Cookieãéä¿¡ã§ãããã©ãããæå®ããŸãã ããã©ã«ãã¯ã off ã§ãã ãã®èšå®ã¯ã PHP 4.0.4ã§è¿œå ãããŸããã session_get_cookie_params() ããã³ session_set_cookie_params() ãåç
§ããŠäžããã
|
session.cache_limiter specifies cache control method to use for session pages (none / nocache / private / private_no_expire / public).
|
session.cache_limiter ã«ãã ã»ãã·ã§ã³ããŒãžã«ããããã£ãã·ã¥å¶åŸ¡ã®æ¹æ³ (none/nocache/private/private_no_expire/public) ãæå®ããŸããããã©ã«ãã¯ã nocache ã§ãã session_cache_limiter() ãåç
§ããŠäžããã
|
session.cache_expire specifies time-to-live for cached session pages in minutes, this has no effect for nocache limiter.
|
session.cache_expire ã«ãããã£ãã·ã¥ããã ã»ãã·ã§ã³ããŒãžã®æå¹æéãååäœã§æå®ããŸãã ãã®ãªãã·ã§ã³ã¯ãnocacheãªããã¿ã«é¢ããŠã¯å¹æããããŸããã ããã©ã«ãã¯ã 180 ã§ãã session_cache_expire() ãåç
§ããŠäžããã
|
session.use_trans_sid whether transparent sid support is enabled or not.
|
session.use_trans_sid ã¯ãééçãªã»ãã·ã§ã³ IDã®ä»å ããããã©ãããæå®ããŸãã ããã©ã«ãã¯ã 0 (ç¡å¹)ã§ãã
|
URL based session management has additional security risks compared to cookie based session management.
|
泚æ PHP 4.1.2ããåã®ããŒãžã§ã³ã§ã¯ããã®ãªãã·ã§ã³ã¯ --enable-trans-sid ã«ãã ã³ã³ãã€ã«æã«æå¹ãšãããŠããŸããã PHP 4.2.0以éãtrans-sidæ©èœã¯åžžã«ã³ã³ãã€ã«ãããŸãã
|
url_rewriter.tags url_rewriter.tags specifies which html tags are rewritten to include session id if transparent sid support is enabled.
|
URLã«åºã¥ãã»ãã·ã§ã³ç®¡çã¯ãCookieã«åºã¥ãã»ãã·ã§ã³ç®¡çãšæ¯ã¹ ãŠã»ãã¥ãªãã£ãªã¹ã¯ã倧ãããªããŸããäŸãã°ããŠãŒã¶ã¯ãemailã« ããå人ã«ã¢ã¯ãã£ããªã»ãã·ã§ã³IDãå«ãURLãéä¿¡ããå¯èœæ§ãã ãããŸãããŠãŒã¶ã¯èªåã®ããã¯ããŒã¯ã«ã»ãã·ã§ã³IDãå«ãURLãä¿ åããåžžã«åãã»ãã·ã§ã³IDã§äœ¿çšãããµã€ãã«ã¢ã¯ã»ã¹ããå¯èœæ§ ããããŸãã
|
The track_vars and register_globals configuration settings influence how the session variables get stored and restored.
|
url_rewriter.tags ã¯ãééçãªã»ãã·ã§ã³IDã® ä»å æ©èœãæå¹ãšãªã£ãå Žåã«ãã»ãã·ã§ã³IDãå«ããããã«æžãæ ããããHTMLã¿ã°ãæå®ããŸããããã©ã«ãã¯ã a=href,area=href,frame=src,input=src,form=fakeentry ã§ãã
|
The constants below are defined by this extension, and will only be available when the extension has either been compiled into PHP or dynamically loaded at runtime.
|
track_vars ããã³ register_globals èšå®ã¯ã»ãã·ã§ã³å€æ°ã®ä¿åããã³ååŸ©æ¹æ³ã«åœ±é¿ãäžããŸãã
|
Note:
|
泚æ PHP 4.0.3以éã track_vars ã¯åžž ã«onãšãªã£ãŠããŸãã
|
Unlike $HTTP_SESSION_VARS, $_SESSION is always global.
|
ãã®æ¡åŒµã¢ãžã¥ãŒã«ã¯ãªãœãŒã¹åãå
šãå®çŸ©ã ãŸããã
|
Please note that this documentation has been changed to use $_SESSION everywhere.
|
ãããã®å®æ°ã¯ããã®æ¡åŒµã¢ãžã¥ãŒã«ã§å®çŸ©ãããŠããã ãã®æ¡åŒµã¢ãžã¥ãŒã«ãPHPå
éšã«ã³ã³ãã€ã«ãããŠãããå®è¡æã«åçã«ã㌠ãããããã®ã©ã¡ããã®å Žåã®ã¿äœ¿çšå¯èœã§ãã
|
Also note that you must start your session using session_start() before use of $_SESSION becomes available.
|
Constant containing the session name and session ID in the form of "name=ID".
|
The restored session variables will only be available in the array $_SESSION.
|
飿³é
å $_SESSION ã®ããŒã¯ãPHPã®éåžžã®å€æ°å ãšåãå¶éããããŸããããªãã¡ãæ°åã§å§ãŸãããšã¯ã§ãããæå㟠ãã¯ã¢ã³ããŒã¹ã³ã¢ã§å§ãŸãå¿
èŠããããŸãã 詳现ã«ã€ããŠã¯ãæ¬ããã¥ã¢ã«ã® 倿° ã®ç¯ãåç
§ããŠäžã ãã
|
With $_SESSION, there is no need to use the session_register(), session_unregister(), session_is_registered() functions.
|
register_globals ãç¡å¹ã®å Žåãã°ããŒãã«é£æ³é
å $_SESSION ã®ã¡ ã³ãã®ã¿ãã»ãã·ã§ã³å€æ°ãšããŠç»é²ããããšãã§ããŸãã å埩ãããã»ãã·ã§ã³å€æ°ã¯ãé
å $_SESSION ã§ã® ã¿å©çšå¯èœã§ãã
|
?php session_start(); / / Use $HTTP_SESSION_VARS with PHP 4.0.6 or less if (!isset($_SESSION['count'])) {$_SESSION['count'] = 0;} else {$_SESSION['count']++;}?
|
ã»ãã¥ãªãã£ãšã³ãŒãã®å¯èªæ§ã®ããã« $_SESSION (ãŸãã¯PHP 4.0.6以å㯠$HTTP_SESSION_VARS )ã®äœ¿çš ãæšå¥šãããŸãã $_SESSION ã®å Žåã session_register(), session_unregister(), session_is_registered() ã¯äžèŠã§ãããŠãŒã¶ã¯ã éåžžã®å€æ°ãšåæ§ã«ã»ãã·ã§ã³å€æ°ã«ã¢ã¯ã»ã¹å¯èœ ã§ãã
|
?php session_start(); / / Use $HTTP_SESSION_VARS with PHP 4.0.6 or less unset($_SESSION['count']);?
|
äŸ 1 $_SESSIONã§å€æ°ãç»é²
|
Unregistering a variable with register_globals enabled, after registering it using $_SESSION.
|
äŸ 2$_SESSIONã§å€æ°ã®ç»é²ãè§£é€ãã
|
If register_globals is enabled, then each global variable can be registered as session variable.
|
äŸ 3 register_globalsãæå¹ãªå Žåã«ã$_SESSIONãçšããŠç»é²ããåŸã 倿°ã®ç»é²ãè§£é€ãã
|
Since PHP must know which global variables are registered as session variables, users need to register variables with session_register() function.
|
register_globals ãæå¹ãªå Žåãå
šãŠã®ã°ããŒãã«å€æ°ã¯ã»ãã·ã§ã³å€æ°ãšããŠç»é²ããã ãšãå¯èœã§ãã»ãã·ã§ã³å€æ°ã¯å¯Ÿå¿ããã°ããŒãã«å€æ°ãšããŠå埩ãã㟠ããPHPã¯ãã©ã®ã°ããŒãã«å€æ°ãã»ãã·ã§ã³å€æ°ãšããŠç»é²ãããã®ã ãç¥ãå¿
èŠãããããããŠãŒã¶ã¯ã倿°ã session_register() 颿°ã§ç»é²ããå¿
èŠããã㟠ãããããã $_SESSION ã®å Žåã¯ããšã³ããªãèšå® ããã ãã§ãããè¡ãå¿
èŠã¯ãããŸããã
|
You can use these functions in 4.3 and later.
|
$_SESSION ã䜿çšãã register_globals ãç¡å¹ãšããå Žåãèªåã®ã¹ã¯ãªãããPHP 4.2ãã以åã®ããŒãžã§ã³ ã§åäœããããå Žåã¯ã session_register(), session_is_registered(), session_unregister() ã䜿çšããªãã§äžããã PHP 4.3以éã§ã¯ãããã®é¢æ°ã䜿çšããããšãã§ããŸãã
|
Disabling register_globals is recommended for both security and performance reasons.
|
register_globals ãæå¹ã«ããŠããå Žåã¯ã session_unregister() ã䜿çšããå¿
èŠããããŸãã ããã¯ãã·ãªã¢ã«åãããã»ãã·ã§ã³ããŒã¿ãæ»ãããæã«ã»ãã·ã§ã³ 倿°ãã°ããŒãã«å€æ°ãšããŠç»é²ãããããã§ãã ã»ãã¥ãªãã£é¢ãšæ§èœé¢ã®åæ¹ãã register_globals ãç¡å¹ãšããããšãæšå¥šãããŠããŸãã
|
Registering a variable with register_globals enabled
|
äŸ 4 register_globals ãæå¹ãªå Žåã«ã倿°ãç»é²ãã
|
If register_globals is enabled, then the global variables and the $_SESSION entries will automatically reference the same values which were registered in the prior session instance.
|
register_globals ãæå¹ãªå Žåãã°ããŒãã«å€æ°ãš $_SESSION ã® ãšã³ããªã¯ãåã®ã»ãã·ã§ã³ã€ã³ã¹ã¿ã³ã¹ã§ç»é²ãããã»ãã·ã§ã³å€æ° ã®åãå€ãåç
§ããããšã«ãªããŸãã
|
I.e. a modification to the newly registered global variable will not be reflected by the $_SESSION entry.
|
å ããŠã session_register() ã«ããæ°ããã»ãã·ã§ ã³å€æ°ãç»é²ããå Žåãã°ããŒãã«ã¹ã³ãŒãã®ãšã³ããªãš $_SESSION ã®ãšã³ããªã¯ã次㮠session_start() ãŸã§åãå€ãžã®ãªãã¡ã¬ã³ã¹ãšã¯ ãªããŸããã(ããã¯ãPHP 4.2ããåã®ããŒãžã§ã³ã®ã¿ã«é©çšãããŸãã) ããªãã¡ãã°ããŒãã«å€æ°ãžã®ä¿®æ£ã¯ã $_SESSION ã®ãšã³ããªã«ã¯åæ ãããŸãããããã¯ãå®éã«ã¯åé¡ã«ã¯ãªããªããš æãããŸãããPHP 4.3ã§ã¯ä¿®æ£ãããŠããŸãã
|
There are two methods to propagate a session id:
|
ã»ãã·ã§ã³IDã®éç¥ãè¡ãããã«ã¯æ¬¡ã®äºã€ã®æ¹æ³ããããŸãã
|
The second method embeds the session id directly into URLs.
|
Cookie
|
Unless you are using PHP 4.2 or later, you need to enable it manually when building PHP.
|
URLãã©ã¡ãŒã¿
|
If this build option and the run-time option session.use_trans_sid are enabled, relative URIs will be changed to contain the session id automatically.
|
sessionã¢ãžã¥ãŒã«ã¯ãäž¡æ¹ã®æ¹æ³ããµããŒãããŸãã Cookieã¯æé©ã§ããã(ã¯ã©ã€ã¢ã³ããCookieãåãå
¥ããªãå¯èœæ§ã ãããã)ä¿¡é Œæ§ããªããããã«äŸåããããšãã§ããŸããã2çªç®ã®æ¹ æ³ã¯ãã»ãã·ã§ã³IDãçŽæ¥URLã«åã蟌ã¿ãŸãã
|
For full XHTML conformance, specify amp; there.
|
PHP ã¯ã --enable-trans-sid ãä»ããŠã³ã³ãã€ã«ããã å Žåã«ãã®åŠçãééçã«è¡ããŸãããã®ãªãã·ã§ã³ã¯ãPHP 4.2以éåžž ã«æå¹ãšãªã£ãŠããŸãããã®ãªãã·ã§ã³ãæå¹ã«ããå Žåãçžå¯Ÿ URI ã¯ã»ãã·ã§ã³IDãæããããã«èªåçã«å€æŽãããŸãã ãããã¯ãã¯ã©ã€ã¢ã³ããé©åœãªã¯ãããŒãéä¿¡ããªãå Žåã« å®çŸ©ããã宿° SID ã䜿çšããããšãã§ããŸãã SID ã¯ã session_name=session_id ã®åœ¢åŒãŸãã¯ç©ºã®æååã§ãã
|
If the client did not send an appropriate session cookie, it has the form session_name=session_id.
|
泚æ arg_separator.output php.ini ãã£ã¬ã¯ãã£ãã«ãããåŒæ°ã®ã»ãã¬ãŒã¿ãã«ã¹ã¿ãã€ãº ããããšãå¯èœã§ãã
|
The following example demonstrates how to register a variable, and how to link correctly to another page using SID.
|
次ã®äŸã¯ã倿°ã®ç»é²æ³ããã³ SID ãçšããŠä»ã®ããŒãžã«æ£ãããªã³ã¯ ããæ¹æ³ã®ãã¢ã§ãã
|
Counting the number of hits of a single user
|
äŸ 5åäžã®ãŠãŒã¶ãŒã«é¢ãããããæ°ãæ°ãã
|
Hello visitor, you have seen this page ?php echo $count;? times. p To continue, A HREF="nextpage.php? ?php echo SID? "click here / A
|
?php echo SID? (short_open_tag ãæå¹ãª å Žå㯠?=SID? ã䜿çšã§ããŸã)ã¯ã ãŠãŒã¶ãCookieãç¡å¹ãšããå Žåã«ã»ãã·ã§ã³IDãä¿åããããã«å¿
èŠ ã§ããPHPã®ã³ã³ãã€ã«æã« --enable-trans-sid ãæå®ããå Žåã«ã¯ã ?php echo SID? ã¯äžèŠã§ãã
|
The ?=SID? is not necessary, if --enable-trans-sid was used to compile PHP.
|
泚æ çžå¯ŸURLã§ãªãURLã¯ãå€éšãµã€ããæããŠãããšä»®å®ããSIDã远å ãããŸãããããã¯ãSIDãç°ãªã£ããµãŒãã«ãããããšã¯ã»ãã¥ãªã㣠äžã®ãªã¹ã¯ãšãªãããã§ãã
|
To implement database storage, or any other storage method, you will need to use session_set_save_handler() to create a set of user-level storage functions.
|
ã»ãã·ã§ã³æ
å ±ãããŒã¿ããŒã¹ã«ä¿åããæ©èœãä»ã®ä¿åæ³ãå®è£
ãã ã«ã¯ãäžé£ã®ãŠãŒã¶ã¬ãã«ã®ä¿å颿°ãäœæãã session_set_save_handler() ã䜿çšããå¿
èŠããã ãŸãã
|
These functions will not typically work on Windows, as it does not support shared memory.
|
shmop ã¯ãå
±æã¡ã¢ãªã»ã°ã¡ã³ããPHPããç°¡åã«èªã¿æžããŸãã¯äœæã åé€ããããšãå¯èœã«ããäžé£ã®é¢æ°ã§ããWindowsäžã§ã¯å
±æã¡ã¢ãªã ãµããŒããããªãããããããã®é¢æ°ã¯åäœããŸããã ããããWindows 2000以éã php_shmop.dll ã php.ini ã§æå¹ã«ããããšã«ããããã®æ©èœãæå¹ã«ããããšãã§ã㟠ãã
|
Note:
|
泚æ PHP 4.0.3ã§ã¯ã以äžã®é¢æ°ã«æ¥é èŸ shmop ã§ã¯ãª ã shm ãä»ããŠããŸããã rather than
|
No external libraries are needed to build this extension.
|
ãããã®é¢æ°ã¯ãæšæºã¢ãžã¥ãŒã«ã®äžéšãš ããŠå©çšå¯èœã§ãããåžžã«äœ¿çšã§ããŸãã
|
This extension has no configuration directives defined in php.ini.
|
shmopã䜿çšããã«ã¯ã --enable-shmop ãã©ã¡ãŒã¿ã configure ã«æ å®ããŠPHPãã³ã³ãã€ã«ããå¿
èŠããããŸãã
|
Example 1.
|
ãã®æ¡åŒµã¢ãžã¥ãŒã«ã¯èšå®ãã£ã¬ã¯ãã£ããå
šã å®çŸ©ããŸããã
|
session_write_close
|
äŸ 1å
±æã¡ã¢ãªæäœã®æŠèŠ
|
On Windows these functions are only available on NT and not on Win95 / 98.
|
UNIXäžã§SNMP颿°ã䜿çšããããã«ã¯ã UCD SNMP ããã±ãŒãžãã€ã³ã¹ããŒã«ããå¿
èŠããããŸãã Windowsäžã§ã¯ããããã®é¢æ°ã¯ NT äžã§ã®ã¿å©çšå¯èœã§ããã Win95/98 ã§ã¯å©çšã§ããŸããã
|
After configuring UCD SNMP, edit config.h and search for NO_ZEROLENGTH_COMMUNITY.
|
éèŠ: UCD SNMP ããã±ãŒãžã䜿çšããã«ã¯ãã³ã³ãã€ã«åã« NO_ZEROLENGTH_COMMUNITYã1ã«å®çŸ©ããå¿
èŠããããŸããUCD SNMPã®ã³ã³ ãã£ã°ã¬ãŒã·ã§ã³ãè¡ã£ãåŸã config.h ãç·šéãã NO_ZEROLENGTH_COMMUNITY ãæ¢ããŠãã ããã #define ã®è¡ã®ã³ã¡ã³ããå€ããŠãã ããã ããã«ãããæ¬¡ã®ããã«ãªãã¯ãã§ãã
|
If you do not want to recompile UCD SNMP, you can compile PHP with the --enable-ucd-snmp-hack switch which will work around the misfeature.
|
SNMP ã³ãã³ããšçµã¿åãããå Žåã«å¥åŠãªã»ã°ã¡ã³ãäŸå€ãçããå Žå ã¯ãäžã®æç€ºã«åŸã£ãŠããªããšæãããŸããUCD SNMPãåã³ã³ãã€ã«ãã ããªãå Žåã¯ããã®äžå
·åã«å¯ŸåŠãããããPHPã --enable-ucd-snmp-hack ã¹ã€ãããã€ããŠã³ã³ãã€ã«ããŠãã ããã
|
This directory should be moved to DRIVE:\usr\mibs, where DRIVE must be replaced with the driveletter where PHP is installed on, e.g.: c:\usr\mibs.
|
Windowsçã¯ãSNMPãµããŒãçšãã¡ã€ã«ã mibs ãã£ã¬ ã¯ããªã«ãããŸãããã®ãã£ã¬ã¯ããªã¯ã directory. This directory should be moved to DRIVE:\usr\mibs, where DRIVE must be replaced with the driveletter where PHP is installed on, e.g.: c:\usr\mibs.
|
This extension has no constants defined.
|
ãã®æ¡åŒµã¢ãžã¥ãŒã«ã¯èšå®ãã£ã¬ã¯ãã£ããå
šã å®çŸ©ããŸããã
|
snmp_get_quick_print
|
ãã®æ¡åŒµã¢ãžã¥ãŒã«ã¯å®æ°ãå
šãå®çŸ©ããŸã ãã
|
For a more generic client-side socket interface, see fsockopen() and pfsockopen().
|
ãœã±ããæ¡åŒµã«ããããœã±ããéä¿¡é¢æ°ãžã®äœã¬ãã«ãªã€ã³ã¿ãŒãã§ãŒã¹ ãå®è£
ãããã¯ã©ã€ã¢ã³ããšããŠã ãã§ãªãããœã±ãããµãŒããŒãšããŠå äœããããšãå¯èœãšãªããŸãã
|
Please be sure to read the descriptions to avoid confusion.
|
ããäžè¬çãªã¯ã©ã€ã¢ã³ããµã€ãã®ãœã±ããã€ã³ã¿ãŒãã§ãŒã¹ã«ã€ããŠã¯ã fsockopen() ããã³ pfsockopen() ãåç
§äžããã
|
The UNIX Socket FAQ might be a good start.
|
ããã§èª¬æãããœã±ãã颿°ã䜿çšããå Žåãå€ãã®é¢æ°ã¯ãCèšèªã«å ãååã®é¢æ°ãååšããŸãããå®çŸ©ãç°ãªã£ãŠããããšã«æ³šæããŠäžããã æ··ä¹±ãé¿ããã«ã¯ã説æãããèªãã§äžããã
|
Use this extension at your own risk.
|
ãã®ããã«ãœã±ãããœã±ããããã°ã©ãã³ã°ãšç°ãªã£ãŠããç¹ã¯ãããŸã ããããã§ãæçšãªå€ãã®UNIX man ããŒãžãåç
§ããããšãã§ããŸãã Webäžã«Cèšèªã®ãœã±ããããã°ã©ãã³ã°ã®ãã¥ãŒããªã¢ã«æ
å ±ãååšãã ãã®å€ãã¯ãè¥å¹²ã®ä¿®æ£ã«ãããPHPã«ããããœã±ããããã°ã©ãã³ã°ã« é©åœããããšãå¯èœã§ãã UNIX Socket FAQ ããæå§ããš ããŠé©ããŠããã§ãããã
|
The socket functions described here are part of an extension to PHP which must be enabled at compile time by giving the --enable-sockets option to configure.
|
ãã®ã¢ãžã¥ãŒã«ã¯ã å®éšç ãªãã®ã§ããããã¯ããããã®é¢æ°ã®åäœã颿°åã¯ããã®ããã¥ã¡ã³ãã«æžãããŠäºé
ãšåæ§ã«åç¥ãªãå°æ¥çãªPHPã®ãªãªãŒã¹ã§å€æŽãããå¯èœæ§ããããŸããæ³šæãåèµ·ãããšãšãã«ããã®ã¢ãžã¥ãŒã«ã¯äœ¿çšè
ã®ãªã¹ã¯ã§äœ¿çšããŠäžããã
|
This extension has no resource types defined.
|
ãããã®é¢æ°ã¯ãæšæºã¢ãžã¥ãŒã«ã®äžéšãš ããŠå©çšå¯èœã§ãããåžžã«äœ¿çšã§ããŸãã
|
The socket extension was written to provide a useable interface to the powerful BSD sockets.
|
ããã«æ¢è¿°ããããœã±ãã颿°ã¯PHPæ¡åŒµã¢ãžã¥ãŒã«ã®äžéšã§ãããã³ã³ ãã€ã«æã« configure ã«ãªãã·ã§ã³ --enable-sockets ãæå®ããããšã«ããäœ¿çš å¯èœãšãªããŸãã
|
Almost all of the sockets functions may fail under certain conditions and therefore emit an E_WARNING message describing the error.
|
ãã®æ¡åŒµã¢ãžã¥ãŒã«ã¯èšå®ãã£ã¬ã¯ãã£ããå
šã å®çŸ©ããŸããã
|
For example the function socket_read() may suddenly emit an E_WARNING message because the connection broke unexpectedly.
|
ãã®æ¡åŒµã¢ãžã¥ãŒã«ã¯ãªãœãŒã¹åãå
šãå®çŸ©ã ãŸããã
|
You may call the socket_strerror() function with this error code to retrieve a string describing the error.
|
ãããã®å®æ°ã¯ããã®æ¡åŒµã¢ãžã¥ãŒã«ã§å®çŸ©ãããŠããã ãã®æ¡åŒµã¢ãžã¥ãŒã«ãPHPå
éšã«ã³ã³ãã€ã«ãããŠãããå®è¡æã«åçã«ã㌠ãããããã®ã©ã¡ããã®å Žåã®ã¿äœ¿çšå¯èœã§ãã
|
You may then connect to the server with a command similar to: telnet 192.168.1.53 10000 (where the address and port match your setup).
|
泚æ E_WARNING ã¡ãã»ãŒãžã¯ããœã±ããæ¡åŒµã¢ãžã¥ãŒ ã«ã«ããè±èªã§çæãããŸãããååŸããããšã©ãŒã¡ãã»ãŒãžã¯ãã«ã¬ ã³ãã®ãã±ãŒã«( LC_MESSAGES )ã«äŸåããŸãã
|
To disconnect, enter 'quit'.
|
äŸ 1ãœã±ããã®äŸ: ç°¡æTCP/IPãµãŒããŒ
|
You said '$buf'.\n"; socket_write ($msgsock, $talkback, strlen ($talkback)); echo "$buf\n";} while (true); socket_close ($msgsock);} while (true); socket_close ($sock);?
|
ãã®äŸã¯ãç°¡åãªå¿çãµãŒããŒã§ãã倿° address ãš port ãèšå®ãšå®è¡ç°å¢ã«åãããã«å€æŽããŠäž ããããã®ãµãŒããŒã«æ¬¡ã®ãããªã³ãã³ãã§æ¥ç¶ããããšãå¯èœã§ãã: telnet 192.168.1.53 10000 (ãã ããã¢ãã¬ã¹ ãšããŒãã¯èšå®ã«åãããŸã)å
¥åãããã®ã¯ããµãŒããŒåŽã®åºåãšãª ãããšã³ãŒããã¯ãããŸããæ¥ç¶ãéããã«ã¯ã'quit'ãå
¥åããŸãã
|
Simple TCP / IP client
|
äŸ 2ãœã±ããã®äŸ: ç°¡æ TCP/IP ã¯ã©ã€ã¢ã³ã
|
It simply connects to a page, submits a HEAD request, echoes the reply, and exits.
|
ãã®äŸã¯ãç°¡åãªäžåéãã®HTTPã¯ã©ã€ã¢ã³ãã§ããããã§ã¯ãããã㌠ãžã«æ¥ç¶ããHEADãªã¯ãšã¹ããéä¿¡ããå¿çãåºåãåŸãçµäºããŸãã
|
A filter is a final piece of code which may perform opperations on data as it is being read from or written to a stream.
|
A stream is referenced as: scheme :// target
|
User designed wrappers can be registered via stream_register_wrapper(), using the class definition shown on that manual page.
|
ãããã®é¢æ°ã¯ãæšæºã¢ãžã¥ãŒã«ã®äžéšãš ããŠå©çšå¯èœã§ãããåžžã«äœ¿çšã§ããŸãã
|
See the manual page for stream_register_filter() for details on implementing user defined filters.
|
Streams are an integral part of PHP as of version 4.3.0. No steps are required to enable them.
|
If this flag is not set, you should not raise any errors.
|
ãã®æ¡åŒµã¢ãžã¥ãŒã«ã¯èšå®ãã£ã¬ã¯ãã£ããå
šã å®çŸ©ããŸããã
|
Unable to connect to remote host, file not found, etc...).
|
User designed wrappers can be registered via stream_register_wrapper(), using the class definition shown on that manual page.
|
As with most PHP internal functions if a failure occours an E_WARNING message will be generated describing the nature of the error.
|
class php_user_filter is predefined and is an abstract baseclass for use with user defined filters. See the manual page for stream_register_filter() for details on implementing user defined filters.
|
Making a POST request to an https server
|
äŸ 1Using file_get_contents() to retrieve data from multiple sources
|
Writting data to a compressed file
|
äŸ 2Making a POST request to an https server
|
stream_context_create
|
äŸ 3Writting data to a compressed file
|
Some more specialized sections can be found in the regular expression and URL handling sections.
|
以äžã®é¢æ°ã¯ãã¹ãŠãæååããããããªæ¹æ³ã§æäœããŸããæ£èŠè¡šçŸã URLåŠçã®ç¯ã«ãé¢é£ããèšè¿°ããããŸãã
|
No external libraries are needed to build this extension.
|
æååã®åäœã«é¢ããæ
å ±ãç¹ã«ã·ã³ã°ã«ã¯ãªãŒããããã«ã¯ãªãŒãããš ã¹ã±ãŒãã·ãŒã±ã³ã¹ã«ã€ããŠã¯ãããã¥ã¢ã«ã® å ã®ç¯ã«ãã æåå ãšã³ããªãåç
§ äžããã
|
This extension has no constants defined.
|
ãããã®é¢æ°ã¯ãæšæºã¢ãžã¥ãŒã«ã®äžéšãš ããŠå©çšå¯èœã§ãããåžžã«äœ¿çšã§ããŸãã
|
Prev
|
ãããã®é¢æ°ã¯PHPã³ã¢ã«å«ãŸããããã䜿çšã ãéã«ã€ã³ã¹ããŒã«ã¯äžèŠã§ãã
|
stream_set_write_buffer
|
ãã®æ¡åŒµã¢ãžã¥ãŒã«ã¯å®æ°ãå
šãå®çŸ©ããŸã ãã
|
addcslashes
|
ãã匷åãªæåååŠçããã³åŠç颿°ã«ã€ããŠã¯ã POSIXæ£èŠè¡šçŸé¢æ° ããã³ Perläºææ£èŠè¡šçŸé¢æ° ãåç
§ããŠäž ããã
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.