php.ini配置
为了使自己的程序在不同的平台中拥有更好的兼容性,很多时候我们都要获取当前Php的运行环境参数。比如我们常用到的:获取magic_quotes_gpc状态,来决定当表单提交时我们是否转义(addslashes)数据;设定max_execution_time来延长程序的执行时间;设定error_reporting使自己的项目在开发与运营阶段切换;设定memory_limit加大内存等等…
ini_set(string varname, string newvalue ) : 设定环境配置的参数
ini_get(string varname) : 获取环境配置的参数
参数列表如下
com.allow_dcom | “0″ | PHP_INI_SYSTEM |
com.autoregister_typelib | “0″ | PHP_INI_SYSTEM |
com.autoregister_verbose | “0″ | PHP_INI_SYSTEM |
com.autoregister_casesensitive | “1″ | PHP_INI_SYSTEM |
com.typelib_file | “” | PHP_INI_SYSTEM |
crack.default_dictionary | NULL | PHP_INI_SYSTEM |
exif.encode_unicode | “ISO-8859-15″ | PHP_INI_ALL |
exif.decode_unicode_motorola | “UCS-2BE” | PHP_INI_ALL |
exif.decode_unicode_intel | “UCS-2LE” | PHP_INI_ALL |
exif.encode_jis | “” | PHP_INI_ALL |
exif.decode_jis_motorola | “JIS” | PHP_INI_ALL |
exif.decode_jis_intel | “JIS” | PHP_INI_ALL |
fbsql.allow_persistent | “1″ | PHP_INI_SYSTEM |
fbsql.generate_warnings | “0″ | PHP_INI_SYSTEM |
fbsql.autocommit | “1″ | PHP_INI_SYSTEM |
fbsql.max_persistent | “-1″ | PHP_INI_SYSTEM |
fbsql.max_links | “128″ | PHP_INI_SYSTEM |
fbsql.max_connections | “128″ | PHP_INI_SYSTEM |
fbsql.max_results | “128″ | PHP_INI_SYSTEM |
fbsql.batchSize | “1000″ | PHP_INI_SYSTEM |
fbsql.default_host | NULL | PHP_INI_SYSTEM |
fbsql.default_user | “_SYSTEM” | PHP_INI_SYSTEM |
fbsql.default_password | “” | PHP_INI_SYSTEM |
fbsql.default_database | “” | PHP_INI_SYSTEM |
fbsql.default_database_password | “” | PHP_INI_SYSTEM |
hwapi.allow_persistent | “0″ | PHP_INI_SYSTEM |
hyperwave.allow_persistent | “0″ | PHP_INI_SYSTEM |
hyperwave.default_port | “418″ | PHP_INI_ALL |
iconv.input_encoding | ICONV_INPUT_ENCODING | PHP_INI_ALL |
iconv.output_encoding | ICONV_OUTPUT_ENCODING | PHP_INI_ALL |
iconv.internal_encoding | ICONV_INTERNAL_ENCODING | PHP_INI_ALL |
ifx.allow_persistent | “1″ | PHP_INI_SYSTEM |
ifx.max_persistent | “-1″ | PHP_INI_SYSTEM |
ifx.max_links | “-1″ | PHP_INI_SYSTEM |
ifx.default_host | NULL | PHP_INI_SYSTEM |
ifx.default_user | NULL | PHP_INI_SYSTEM |
ifx.default_password | NULL | PHP_INI_SYSTEM |
ifx.blobinfile | “1″ | PHP_INI_ALL |
ifx.textasvarchar | “0″ | PHP_INI_ALL |
ifx.byteasvarchar | “0″ | PHP_INI_ALL |
ifx.charasvarchar | “0″ | PHP_INI_ALL |
ifx.nullformat | “0″ | PHP_INI_ALL |
ingres.allow_persistent | “1″ | PHP_INI_SYSTEM |
ingres.max_persistent | “-1″ | PHP_INI_SYSTEM |
ingres.max_links | “-1″ | PHP_INI_SYSTEM |
ingres.default_database | NULL | PHP_INI_ALL |
ingres.default_user | NULL | PHP_INI_ALL |
ingres.default_password | NULL | PHP_INI_ALL |
ibase.allow_persistent | “1″ | PHP_INI_SYSTEM |
ibase.max_persistent | “-1″ | PHP_INI_SYSTEM |
ibase.max_links | “-1″ | PHP_INI_SYSTEM |
ibase.default_user | NULL | PHP_INI_ALL |
ibase.default_password | NULL | PHP_INI_ALL |
ibase.timestampformat | “%m/%d/%Y%H:%M:%S” | PHP_INI_ALL |
ibase.dateformat | “%m/%d/%Y” | PHP_INI_ALL |
ibase.timeformat | “%H:%M:%S” | PHP_INI_ALL |
java.class.path | NULL | PHP_INI_ALL |
java.home | NULL | PHP_INI_ALL |
java.library.path | NULL | PHP_INI_ALL |
java.library | JAVALIB | PHP_INI_ALL |
java.library | NULL | PHP_INI_ALL |
ldap.max_links | “-1″ | PHP_INI_SYSTEM |
mbstring.detect_order | NULL | PHP_INI_ALL |
mbstring.http_input | NULL | PHP_INI_ALL |
mbstring.http_output | NULL | PHP_INI_ALL |
mbstring.internal_encoding | NULL | PHP_INI_ALL |
mbstring.substitute_character | NULL | PHP_INI_ALL |
mbstring.func_overload | “0″ | PHP_INI_SYSTEM |
mcrypt.algorithms_dir | NULL | PHP_INI_ALL |
mcrypt.modes_dir | NULL | PHP_INI_ALL |
mime_magic.magicfile | “/usr/share/misc/magic.mime” | PHP_INI_SYSTEM |
mssql.allow_persistent | “1″ | PHP_INI_SYSTEM |
mssql.max_persistent | “-1″ | PHP_INI_SYSTEM |
mssql.max_links | “-1″ | PHP_INI_SYSTEM |
mssql.max_procs | “25″ | PHP_INI_ALL |
mssql.min_error_severity | “10″ | PHP_INI_ALL |
mssql.min_message_severity | “10″ | PHP_INI_ALL |
mssql.compatability_mode | “0″ | PHP_INI_ALL |
mssql.connect_timeout | “5″ | PHP_INI_ALL |
mssql.timeout | “60″ | PHP_INI_ALL |
mssql.textsize | “-1″ | PHP_INI_ALL |
mssql.textlimit | “-1″ | PHP_INI_ALL |
mssql.batchsize | “0″ | PHP_INI_ALL |
mssql.datetimeconvert | “1″ | PHP_INI_ALL |
mssql.secure_connection | “0″ | PHP_INI_SYSTEM |
mysql.allow_persistent | “1″ | PHP_INI_SYSTEM |
mysql.max_persistent | “-1″ | PHP_INI_SYSTEM |
mysql.max_links | “-1″ | PHP_INI_SYSTEM |
mysql.default_host | NULL | PHP_INI_ALL |
mysql.default_user | NULL | PHP_INI_ALL |
mysql.default_password | NULL | PHP_INI_ALL |
mysql.default_port | NULL | PHP_INI_ALL |
mysql.default_socket | NULL | PHP_INI_ALL |
ncurses.value | “42″ | PHP_INI_ALL |
ncurses.string | “foobar” | PHP_INI_ALL |
odbc.allow_persistent | “1″ | PHP_INI_SYSTEM |
odbc.max_persistent | “-1″ | PHP_INI_SYSTEM |
odbc.max_links | “-1″ | PHP_INI_SYSTEM |
odbc.default_db | NULL | PHP_INI_ALL |
odbc.default_user | NULL | PHP_INI_ALL |
odbc.default_pw | NULL | PHP_INI_ALL |
odbc.defaultlrl | “4096″ | PHP_INI_ALL |
odbc.defaultbinmode | “1″ | PHP_INI_ALL |
odbc.check_persistent | “1″ | PHP_INI_SYSTEM |
pfpro.defaulthost | “test.signio.com” | |
pfpro.defaulthost | “test-payflow.verisign.com” | |
pfpro.defaultport | “443″ | PHP_INI_ALL |
pfpro.defaulttimeout | “30″ | PHP_INI_ALL |
pfpro.proxyaddress | “” | PHP_INI_ALL |
pfpro.proxyport | “” | PHP_INI_ALL |
pfpro.proxylogon | “” | PHP_INI_ALL |
pfpro.proxypassword | “” | PHP_INI_ALL |
pgsql.allow_persistent | “1″ | PHP_INI_SYSTEM |
pgsql.max_persistent | “-1″ | PHP_INI_SYSTEM |
pgsql.max_links | “-1″ | PHP_INI_SYSTEM |
pgsql.auto_reset_persistent | “0″ | PHP_INI_SYSTEM |
pgsql.ignore_notice | “0″ | PHP_INI_ALL |
pgsql.log_notice | “0″ | PHP_INI_ALL |
session.save_path | “/tmp” | PHP_INI_ALL |
session.name | “PHPSESSID” | PHP_INI_ALL |
session.save_handler | “files” | PHP_INI_ALL |
session.auto_start | “0″ | PHP_INI_ALL |
session.gc_probability | “1″ | PHP_INI_ALL |
session.gc_divisor | “100″ | PHP_INI_ALL |
session.gc_maxlifetime | “1440″ | PHP_INI_ALL |
session.serialize_handler | “php” | PHP_INI_ALL |
session.cookie_lifetime | “0″ | PHP_INI_ALL |
session.cookie_path | “/” | PHP_INI_ALL |
session.cookie_domain | “” | PHP_INI_ALL |
session.cookie_secure | “” | PHP_INI_ALL |
session.use_cookies | “1″ | PHP_INI_ALL |
session.use_only_cookies | “0″ | PHP_INI_ALL |
session.referer_check | “” | PHP_INI_ALL |
session.entropy_file | “” | PHP_INI_ALL |
session.entropy_length | “0″ | PHP_INI_ALL |
session.cache_limiter | “nocache” | PHP_INI_ALL |
session.cache_expire | “180″ | PHP_INI_ALL |
session.use_trans_sid | “0″ | PHP_INI_SYSTEM PHP_INI_PERDIR |
session.encode_sources | “globals,track” | PHP_INI_ALL |
assert.active | “1″ | PHP_INI_ALL |
assert.bail | “0″ | PHP_INI_ALL |
assert.warning | “1″ | PHP_INI_ALL |
assert.callback | NULL | PHP_INI_ALL |
assert.quiet_eval | “0″ | PHP_INI_ALL |
safe_mode_protected_env_vars | SAFE_MODE_PROTECTED_ENV_VARS | PHP_INI_SYSTEM |
safe_mode_allowed_env_vars | SAFE_MODE_ALLOWED_ENV_VARS | PHP_INI_SYSTEM |
url_rewriter.tags | “a=href,area=href, frame=src, form=fakeentry” | PHP_INI_ALL |
sybct.allow_persistent | “1″ | PHP_INI_SYSTEM |
sybct.max_persistent | “-1″ | PHP_INI_SYSTEM |
sybct.max_links | “-1″ | PHP_INI_SYSTEM |
sybct.min_server_severity | “10″ | PHP_INI_ALL |
sybct.min_client_severity | “10″ | PHP_INI_ALL |
sybct.hostname | NULL | PHP_INI_ALL |
vpopmail.directory | “” | PHP_INI_ALL |
zlib.output_compression | “0″ | PHP_INI_SYSTEM PHP_INI_PERDIR |
zlib.output_compression_level | “-1″ | PHP_INI_ALL |
define_syslog_variables | “0″ | PHP_INI_ALL |
highlight.bg | HL_BG_COLOR | PHP_INI_ALL |
highlight.comment | HL_COMMENT_COLOR | PHP_INI_ALL |
highlight.default | HL_DEFAULT_COLOR | PHP_INI_ALL |
highlight.html | HL_HTML_COLOR | PHP_INI_ALL |
highlight.keyword | HL_KEYWORD_COLOR | PHP_INI_ALL |
highlight.string | HL_StrING_COLOR | PHP_INI_ALL |
allow_call_time_pass_reference | “1″ | PHP_INI_SYSTEM PHP_INI_PERDIR |
asp_tags | “0″ | PHP_INI_SYSTEM PHP_INI_PERDIR |
display_errors | “1″ | PHP_INI_ALL |
display_startup_errors | “0″ | PHP_INI_ALL |
enable_dl | “1″ | PHP_INI_SYSTEM |
expose_php | “1″ | PHP_INI_SYSTEM |
html_errors | “1″ | PHP_INI_ALL |
xmlrpc_errors | “0″ | PHP_INI_SYSTEM |
xmlrpc_error_number | “0″ | PHP_INI_ALL |
ignore_user_abort | “0″ | PHP_INI_ALL |
implicit_flush | “0″ | PHP_INI_ALL |
log_errors | “0″ | PHP_INI_ALL |
log_errors_max_len | “1024″ | PHP_INI_ALL |
ignore_repeated_errors | “0″ | PHP_INI_ALL |
ignore_repeated_source | “0″ | PHP_INI_ALL |
magic_quotes_gpc | “1″ | PHP_INI_PERDIR PHP_INI_SYSTEM |
magic_quotes_runtime | “0″ | PHP_INI_ALL |
magic_quotes_sybase | “0″ | PHP_INI_ALL |
output_buffering | “0″ | PHP_INI_PERDIR PHP_INI_SYSTEM |
output_handler | NULL | PHP_INI_PERDIR PHP_INI_SYSTEM |
register_argc_argv | “1″ | PHP_INI_PERDIR PHP_INI_SYSTEM |
register_globals | “0″ | PHP_INI_PERDIR PHP_INI_SYSTEM |
safe_mode | “1″ | PHP_INI_SYSTEM |
safe_mode | “0″ | PHP_INI_SYSTEM |
safe_mode_include_dir | NULL | PHP_INI_SYSTEM |
safe_mode_gid | “0″ | PHP_INI_SYSTEM |
short_open_tag | DEFAULT_SHORT_OPEN_TAG | PHP_INI_SYSTEM PHP_INI_PERDIR |
sql.safe_mode | “0″ | PHP_INI_SYSTEM |
track_errors | “0″ | PHP_INI_ALL |
y2k_compliance | “0″ | PHP_INI_ALL |
unserialize_callback_func | NULL | PHP_INI_ALL |
arg_separator.output | “&” | PHP_INI_ALL |
arg_separator.input | “&” | PHP_INI_SYSTEM PHP_INI_PERDIR |
auto_append_file | NULL | PHP_INI_SYSTEM PHP_INI_PERDIR |
auto_prepend_file | NULL | PHP_INI_SYSTEM PHP_INI_PERDIR |
doc_root | NULL | PHP_INI_SYSTEM |
default_charset | SAPI_DEFAULT_CHARSET | PHP_INI_ALL |
default_mimetype | SAPI_DEFAULT_MIMETYPE | PHP_INI_ALL |
error_log | NULL | PHP_INI_ALL |
extension_dir | PHP_EXTENSION_DIR | PHP_INI_SYSTEM |
gpc_order | “GPC” | PHP_INI_ALL |
include_path | PHP_INCLUDE_PAth | PHP_INI_ALL |
max_execution_time | “30″ | PHP_INI_ALL |
open_basedir | NULL | PHP_INI_SYSTEM |
safe_mode_exec_dir | “1″ | PHP_INI_SYSTEM |
upload_max_filesize | “2M” | PHP_INI_SYSTEM PHP_INI_PERDIR |
file_uploads | “1″ | PHP_INI_SYSTEM |
post_max_size | “8M” | PHP_INI_SYSTEM PHP_INI_PERDIR |
upload_tmp_dir | NULL | PHP_INI_SYSTEM |
user_dir | NULL | PHP_INI_SYSTEM |
variables_order | NULL | PHP_INI_ALL |
error_append_string | NULL | PHP_INI_ALL |
error_prepend_string | NULL | PHP_INI_ALL |
SMTP | “localhost” | PHP_INI_ALL |
smtp_port | 25 | PHP_INI_ALL |
browscap | NULL | PHP_INI_SYSTEM |
error_reporting | NULL | PHP_INI_ALL |
memory_limit | “8M” | PHP_INI_ALL |
precision | “14″ | PHP_INI_ALL |
sendmail_from | NULL | PHP_INI_ALL |
sendmail_path | DEFAULT_SENDMAIL_PAth | PHP_INI_SYSTEM |
disable_classes | “” | php.ini only |
disable_functions | “” | php.ini only |
allow_url_fopen | “1″ | PHP_INI_ALL |
always_populate_raw_post_data | “0″ | PHP_INI_SYSTEM PHP_INI_PERDIR |
xbithack | “0″ | PHP_INI_ALL |
engine | “1″ | PHP_INI_ALL |
last_modified | “0″ | PHP_INI_ALL |
child_terminate | “0″ | PHP_INI_ALL |
async_send | “0″ | PHP_INI_ALL |
可操作范围见下表:
操作范围
PHP_INI_USER | 1 | Entry can be set in user scripts |
PHP_INI_PERDIR | 2 | Entry can be set in php.ini, .htaccess or httpd.conf |
PHP_INI_SYSTEM | 4 | Entry can be set in php.ini or httpd.conf |
PHP_INI_ALL | 7 | Entry can be set anywhere |

핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

Video Face Swap
완전히 무료인 AI 얼굴 교환 도구를 사용하여 모든 비디오의 얼굴을 쉽게 바꾸세요!

인기 기사

뜨거운 도구

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전
중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경

드림위버 CS6
시각적 웹 개발 도구

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)

PHP에는 4 가지 주요 오류 유형이 있습니다. 1. NOTICE : 가장 작은 것은 정의되지 않은 변수에 액세스하는 것과 같이 프로그램을 방해하지 않습니다. 2. 경고 : 심각한 통지는 파일을 포함하지 않는 것과 같은 프로그램을 종료하지 않습니다. 3. FatalError : 가장 심각한 것은 기능을 부르는 것과 같은 프로그램을 종료합니다. 4. parseerror : 구문 오류는 엔드 태그를 추가하는 것을 잊어 버리는 것과 같이 프로그램이 실행되는 것을 방지합니다.

PHP에서 Password_hash 및 Password_Verify 기능을 사용하여 보안 비밀번호 해싱을 구현해야하며 MD5 또는 SHA1을 사용해서는 안됩니다. 1) Password_hash는 보안을 향상시키기 위해 소금 값이 포함 된 해시를 생성합니다. 2) Password_verify 암호를 확인하고 해시 값을 비교하여 보안을 보장합니다. 3) MD5 및 SHA1은 취약하고 소금 값이 부족하며 현대 암호 보안에는 적합하지 않습니다.

PHP와 Python은 각각 고유 한 장점이 있으며 프로젝트 요구 사항에 따라 선택합니다. 1.PHP는 웹 개발, 특히 웹 사이트의 빠른 개발 및 유지 보수에 적합합니다. 2. Python은 간결한 구문을 가진 데이터 과학, 기계 학습 및 인공 지능에 적합하며 초보자에게 적합합니다.

PHP는 전자 상거래, 컨텐츠 관리 시스템 및 API 개발에 널리 사용됩니다. 1) 전자 상거래 : 쇼핑 카트 기능 및 지불 처리에 사용됩니다. 2) 컨텐츠 관리 시스템 : 동적 컨텐츠 생성 및 사용자 관리에 사용됩니다. 3) API 개발 : 편안한 API 개발 및 API 보안에 사용됩니다. 성능 최적화 및 모범 사례를 통해 PHP 애플리케이션의 효율성과 유지 보수 성이 향상됩니다.

HTTP 요청 방법에는 각각 리소스를 확보, 제출, 업데이트 및 삭제하는 데 사용되는 Get, Post, Put and Delete가 포함됩니다. 1. GET 방법은 리소스를 얻는 데 사용되며 읽기 작업에 적합합니다. 2. 게시물은 데이터를 제출하는 데 사용되며 종종 새로운 리소스를 만드는 데 사용됩니다. 3. PUT 방법은 리소스를 업데이트하는 데 사용되며 완전한 업데이트에 적합합니다. 4. 삭제 방법은 자원을 삭제하는 데 사용되며 삭제 작업에 적합합니다.

PHP는 서버 측에서 널리 사용되는 스크립팅 언어이며 특히 웹 개발에 적합합니다. 1.PHP는 HTML을 포함하고 HTTP 요청 및 응답을 처리 할 수 있으며 다양한 데이터베이스를 지원할 수 있습니다. 2.PHP는 강력한 커뮤니티 지원 및 오픈 소스 리소스를 통해 동적 웹 컨텐츠, 프로세스 양식 데이터, 액세스 데이터베이스 등을 생성하는 데 사용됩니다. 3. PHP는 해석 된 언어이며, 실행 프로세스에는 어휘 분석, 문법 분석, 편집 및 실행이 포함됩니다. 4. PHP는 사용자 등록 시스템과 같은 고급 응용 프로그램을 위해 MySQL과 결합 할 수 있습니다. 5. PHP를 디버깅 할 때 error_reporting () 및 var_dump ()와 같은 함수를 사용할 수 있습니다. 6. 캐싱 메커니즘을 사용하여 PHP 코드를 최적화하고 데이터베이스 쿼리를 최적화하며 내장 기능을 사용하십시오. 7

phpoop에서 self ::는 현재 클래스를 말하며, Parent ::는 부모 클래스를 말하며, static ::는 늦은 static 바인딩에 사용됩니다. 1. self :: 정적 방법과 일정한 호출에 사용되지만 늦은 정적 바인딩을 지원하지는 않습니다. 2.parent :: 하위 클래스가 상위 클래스 방법을 호출하는 데 사용되며 개인 방법에 액세스 할 수 없습니다. 3. Static ::는 상속 및 다형성에 적합한 후기 정적 결합을 지원하지만 코드의 가독성에 영향을 줄 수 있습니다.

PHP는 $ \ _ 파일 변수를 통해 파일 업로드를 처리합니다. 보안을 보장하는 방법에는 다음이 포함됩니다. 1. 오류 확인 확인, 2. 파일 유형 및 크기 확인, 3 파일 덮어 쓰기 방지, 4. 파일을 영구 저장소 위치로 이동하십시오.
