欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  网络运营

简单谈谈centos7中配置php

程序员文章站 2022-10-17 21:55:57
安装: yum  -y  install  php  php-devel  php-pear  php-m...

安装:

yum  -y  install  php  php-devel  php-pear  php-mysql

配置:

vim /etc/php.ini
display_errors = on  #  允许php报告错误
upload_max_filesize = 20m  #  上传文件大小限制
memory_limit = 512m  #  内存使用量
default_socket_timeout = -1  #  脚本超时时间,设置为无期限

完整配置文件参考:

[php]
engine = on
short_open_tag = off
asp_tags = off
precision = 14
output_buffering = 4096
zlib.output_compression = off
implicit_flush = off
unserialize_callback_func =
serialize_precision = 17
disable_functions =
disable_classes =
zend.enable_gc = on
expose_php = on
max_execution_time = 30
max_input_time = 60
memory_limit = 512m
error_reporting = e_all & ~e_deprecated & ~e_strict
display_errors = on
display_startup_errors = off
log_errors = on
log_errors_max_len = 1024
ignore_repeated_errors = off
ignore_repeated_source = off
report_memleaks = on
track_errors = off
html_errors = on
variables_order = "gpcs"
request_order = "gp"
register_argc_argv = off
auto_globals_jit = on
post_max_size = 8m
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
doc_root =
user_dir =
enable_dl = off
file_uploads = on
upload_max_filesize = 20m
max_file_uploads = 20
allow_url_fopen = on
allow_url_include = off
default_socket_timeout = -1
[cli server]
cli_server.color = on
[date]
[filter]
[iconv]
[intl]
[sqlite]
[sqlite3]
[pcre]
[pdo]
[pdo_mysql]
pdo_mysql.cache_size = 2000
pdo_mysql.default_socket=
[phar]
[mail function]
smtp = localhost
smtp_port = 25
sendmail_path = /usr/sbin/sendmail -t -i
mail.add_x_header = on
[sql]
sql.safe_mode = off
[odbc]
odbc.allow_persistent = on
odbc.check_persistent = on
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1
[interbase]
ibase.allow_persistent = 1
ibase.max_persistent = -1
ibase.max_links = -1
ibase.timestampformat = "%y-%m-%d %h:%m:%s"
ibase.dateformat = "%y-%m-%d"
ibase.timeformat = "%h:%m:%s"
[mysql]
mysql.allow_local_infile = on
mysql.allow_persistent = on
mysql.cache_size = 2000
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =
mysql.default_socket =
mysql.default_host =
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = off
[mysqli]
mysqli.max_persistent = -1
mysqli.allow_persistent = on
mysqli.max_links = -1
mysqli.cache_size = 2000
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = off
[mysqlnd]
mysqlnd.collect_statistics = on
mysqlnd.collect_memory_statistics = off
[oci8]
[postgresql]
pgsql.allow_persistent = on
pgsql.auto_reset_persistent = off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0
[sybase-ct]
sybct.allow_persistent = on
sybct.max_persistent = -1
sybct.max_links = -1
sybct.min_server_severity = 10
sybct.min_client_severity = 10
[bcmath]
bcmath.scale = 0
[browscap]
[session]
session.save_handler = files
session.use_cookies = 1
session.use_only_cookies = 1
session.name = phpsessid
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.serialize_handler = php
session.gc_probability = 1
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.bug_compat_42 = off
session.bug_compat_warn = off
session.referer_check =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.hash_function = 0
session.hash_bits_per_character = 5
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
[mssql]
mssql.allow_persistent = on
mssql.max_persistent = -1
mssql.max_links = -1
mssql.min_error_severity = 10
mssql.min_message_severity = 10
mssql.compatability_mode = off
mssql.secure_connection = off
[assertion]
[mbstring]
[gd]
[exif]
[tidy]
tidy.clean_output = off
[soap]
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400
soap.wsdl_cache_limit = 5
[sysvshm]
[ldap]
ldap.max_links = -1
[mcrypt]
[dba]