FreeBSD Web Hosting System php.ini

Bash, Shell, PHP, Python, Perl, CGI
User avatar
Proteus
Posts: 272
Joined: 2013-04-14 05:08
Location: Holzgerlingen

FreeBSD Web Hosting System php.ini

Post by Proteus » 2014-03-27 10:50

Hallo,

ich will erst mal erkläre was es mit http://smacbans.com auf sich hat. Wir sind eine kleine Gemeinde und haben uns vorgenommen Leute die bei CSS CSGO cheaten mächtig an Bein zu pinkeln. Bis jetzt haben wir knapp 200.000 Bans zu verzeichnen und daher habe ich als Admin ein schnelles System mit FreeBSD, Nginx, PHP-FPM und MySQL 5.6 gewählt. Jou User hat dafür auch eine gute Anleitung gemacht und die auch zum Teil sprich MySQL und PHP anwende. Wir haben nur das kleine Problem, das unsere Grafischen Stats mit der php.ini aus dem FreeBSD Web Hosting entnommen, nicht mehr angezeigt angezeigt werden, und ich komme einfach nicht dahinter welcher Parameter in der php.ini gesetzt werden muss, damit die Grafiken siehe Bilder wider angezeigt werden siehe Bilder unten:

Aus der vorkonfigurieren php.ini siehe Bild:
http://prntscr.com/34ixjq

Aus der php.ini aus der FreeBSD Web Hosting System
http://prntscr.com/34ixtc

Welchen Parameter muss ich setzen?
LG
Proti

https://phoenix-blog.de

"Die Kamera wird bei hohen ISO Werten aber rauschen. Nichts ahnend hielt er sich die Kamera ans Ohr!"

User avatar
Joe User
Project Manager
Project Manager
Posts: 11578
Joined: 2003-02-27 01:00
Location: Hamburg

Re: FreeBSD Web Hosting System php.ini

Post by Joe User » 2014-03-27 13:51

Die signifikanten von mir vorgenommenen Anpassungen gegenüber der php.ini-production sind diese:

Code: Select all

max_execution_time = "60"
memory_limit = "256M"
pcre.backtrack_limit = "8M"
post_max_size = "16M"
realpath_cache_size = "512000"
upload_max_filesize = "64M"

Zusätzlich habe ich dort den OPCode-Cache aktiviert, welcher sich einfach wieder abschalten lässt:

Code: Select all

opcache.enable = "0"
opcache.enable_cli = "0"

Alle anderen Anpassungen sind marginal und haben üblicherweise keine Nebenwirkungen.

Du solltest erstmal den OPCode-Cache deaktivieren.
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.

User avatar
Proteus
Posts: 272
Joined: 2013-04-14 05:08
Location: Holzgerlingen

Re: FreeBSD Web Hosting System php.ini

Post by Proteus » 2014-03-27 14:57

Jetzt habe ich die Parameter geändert doch die Grafiken lassen sich dennoch nicht erzeugen.

Hier mal ein Auszug aus unsere php.ini

Code: Select all

allow_url_fopen = "1"
allow_url_include = "0"
arg_separator.input = ";&"
arg_separator.output = "&"
auto_globals_jit = "1"
bcmath.scale = "0"
cli_server.color = "1"
date.default_latitude = "53.5500"
date.default_longitude = "10.0000"
date.sunrise_zenith = "90.583333"
date.sunset_zenith = "90.583333"
date.timezone = "Europe/Berlin"
dba.default_handler = "flatfile"
display_errors = "0"
display_startup_errors = "0"
enable_dl = "0"
error_log = "/var/log/php_error.log"
error_reporting = "E_ALL & ~E_DEPRECATED & ~E_STRICT"
exif.decode_jis_intel = "JIS"
exif.decode_jis_motorola = "JIS"
exif.decode_unicode_intel = "UCS-2LE"
exif.decode_unicode_motorola = "UCS-2BE"
exif.encode_jis = "UTF-8"
exif.encode_unicode = "UTF-8"
expose_php = "0"
file_uploads = "1"
from = "anonymous@example.org"
gd.jpeg_ignore_warning = "0"
html_errors = "0"
ignore_repeated_errors = "0"
ignore_repeated_source = "0"
implicit_flush = "0"
log_errors = "1"
mail.add_x_header = "1"
mail.log = "/var/log/php_sendmail.log"
max_execution_time = 1000
max_file_uploads = "20"
max_input_nesting_level = "64"
max_input_time = 1000
max_input_vars = "1000"
mbstring.detect_order = "auto"
mbstring.encoding_translation = "0"
mbstring.func_overload = "0"
mbstring.http_input = "pass"
mbstring.http_output = "pass"
mbstring.http_output_conv_mimetype = "^(text/|application/xhtml\+xml)"
mbstring.internal_encoding = "UTF-8"
mbstring.language = "neutral"
mbstring.strict_detection = "1"
mbstring.substitute_character = None
memory_limit = "256M"
mysql.allow_local_infile = "1"
mysql.allow_persistent = "1"
mysql.cache_size = "2000"
mysql.connect_timeout = "60"
mysql.default_host = "localhost"
mysql.default_port = "3306"
mysql.default_socket = "/tmp/mysql.sock"
mysql.max_links = "-1"
mysql.max_persistent = "-1"
mysql.trace_mode = "0"
mysqli.allow_local_infile = "1"
mysqli.allow_persistent = "1"
mysqli.cache_size = "2000"
mysqli.connect_timeout = "60"
mysqli.default_host = "localhost"
mysqli.default_port = "3306"
mysqli.default_socket = "/tmp/mysql.sock"
mysqli.max_links = "-1"
mysqli.max_persistent = "-1"
mysqli.reconnect = "1"
mysqli.trace_mode = "0"
mysqlnd.collect_memory_statistics = "1"
mysqlnd.collect_statistics = "1"
mysqlnd.net_cmd_buffer_size = "2048"
mysqlnd.net_read_buffer_size = "32768"
;opcache.blacklist_filename =
opcache.consistency_checks = "0"
opcache.dups_fix = "0"
opcache.enable = "0"
opcache.enable_cli = "0"
opcache.enable_file_override = "1"
opcache.error_log = "/var/log/php_opcache.log"
opcache.fast_shutdown = "1"
opcache.force_restart_timeout = "180"
opcache.interned_strings_buffer = "8"
opcache.load_comments = "1"
opcache.log_verbosity_level = "2"
opcache.max_accelerated_files = "4000"
opcache.max_file_size = "0"
opcache.max_wasted_percentage = "5"
opcache.memory_consumption = "128"
opcache.optimization_level = "0xffffffff"
;opcache.preferred_memory_model =
opcache.protect_memory = "0"
opcache.revalidate_freq = "60"
opcache.revalidate_path = "1"
opcache.save_comments = "1"
opcache.use_cwd = "1"
opcache.validate_timestamps = "1"
output_buffering = "4096"
pcre.backtrack_limit = "8M"
pdo_mysql.cache_size = "2000"
pdo_mysql.default_socket = "/tmp/mysql.sock"
pgsql.allow_persistent = "1"
pgsql.auto_reset_persistent = "0"
pgsql.ignore_notice = "0"
pgsql.log_notice = "0"
pgsql.max_links = "-1"
pgsql.max_persistent = "-1"
post_max_size = "512"
realpath_cache_size = "512000"
register_argc_argv = "1"
register_long_arrays = "on"
request_order = "GP"
sendmail_path = "/usr/sbin/sendmail -t -i "
session.bug_compat_42 = "0"
session.bug_compat_warn = "0"
session.cache_expire = "180"
session.cache_limiter = "nocache"
session.cookie_httponly = "1"
; session.cookie_lifetime = "0"
session.cookie_path = "/"
session.entropy_file = "/dev/urandom"
session.entropy_length = "32"
session.gc_divisor = "1000"
; session.gc_maxlifetime = "1440"
session.gc_probability = "1"
session.hash_bits_per_character = "5"
session.hash_function = "1"
session.name = "PHPSESSID"
session.save_handler = files
session.save_path = /data/tmp/php/session
session.serialize_handler = "php"
session.use_cookies = On
session.use_only_cookies = On
session.use_strict_mode = "1"
session.use_trans_sid = "0"
short_open_tag = "0"
soap.wsdl_cache_dir = "/data/tmp/php/wsdl"
soap.wsdl_cache_enabled = "1"
soap.wsdl_cache_limit = "5"
soap.wsdl_cache_ttl = "86400"
sql.safe_mode = "0"
sys_temp_dir = "/data/tmp/php"
sysvshm.init_mem = "10000"
upload_max_filesize = "512"
upload_tmp_dir = "/data/tmp/php/uploads"
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry,fieldset="
user_ini.filename = None
variables_order = "GPCS"
zend.enable_gc = "1"
zlib.output_compression = "0"
LG
Proti

https://phoenix-blog.de

"Die Kamera wird bei hohen ISO Werten aber rauschen. Nichts ahnend hielt er sich die Kamera ans Ohr!"

User avatar
Joe User
Project Manager
Project Manager
Posts: 11578
Joined: 2003-02-27 01:00
Location: Hamburg

Re: FreeBSD Web Hosting System php.ini

Post by Joe User » 2014-03-27 16:29

Folgende Werte halte ich für bedenklich:

Code: Select all

max_execution_time = 1000
max_input_time = 1000

1000 Sekunden sind extrem lang und können leicht für einen DoS ausgenutzt werden.

Code: Select all

post_max_size = "512"
upload_max_filesize = "512"

512 Byte sind hingegen sehr niedrig.

Code: Select all

register_argc_argv = "1"

Sicherheitsrisiko, braucht Ihr das wirklich?

Code: Select all

register_long_arrays = "on"

Schon lange deprecated und zudem seit PHP 5.4 entfernt.

Darüberhinaus sollten Werte (ausser None) immer in "" verpackt werden.

"On" und "Off" sind gleich "1" und "0", wobei nur letztere intern verwendet werden und daher eine Konvertierung stattfindet, wenn "On" und "Off" verwendet werden. Ist nicht relevant, ausser man braucht die paar Nanosekunden beim Start von PHP (zum Beispiel bei PHP-CLI oder PHP-CGI wo die php.ini bei jedem einzelnen Aufruf neu eingelesen wird).


Ihr solltet die genannten Werte nochmal stark überdenken, insbesondere die 512 Byte ;)
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.

User avatar
Proteus
Posts: 272
Joined: 2013-04-14 05:08
Location: Holzgerlingen

Re: FreeBSD Web Hosting System php.ini

Post by Proteus » 2014-03-27 17:00

Habe alle Werte wie empfohlen angepasst und in Klammern gesetzt. Grafiken werden dennoch immer nicht erzeugt.

Code: Select all

allow_url_fopen = "1"
allow_url_include = "0"
arg_separator.input = ";&"
arg_separator.output = "&"
auto_globals_jit = "1"
bcmath.scale = "0"
cli_server.color = "1"
date.default_latitude = "53.5500"
date.default_longitude = "10.0000"
date.sunrise_zenith = "90.583333"
date.sunset_zenith = "90.583333"
date.timezone = "Europe/Berlin"
dba.default_handler = "flatfile"
display_errors = "0"
display_startup_errors = "0"
enable_dl = "0"
error_log = "/var/log/php_error.log"
error_reporting = "E_ALL & ~E_DEPRECATED & ~E_STRICT"
exif.decode_jis_intel = "JIS"
exif.decode_jis_motorola = "JIS"
exif.decode_unicode_intel = "UCS-2LE"
exif.decode_unicode_motorola = "UCS-2BE"
exif.encode_jis = "UTF-8"
exif.encode_unicode = "UTF-8"
expose_php = "0"
file_uploads = "1"
from = "anonymous@example.org"
gd.jpeg_ignore_warning = "0"
html_errors = "0"
ignore_repeated_errors = "0"
ignore_repeated_source = "0"
implicit_flush = "0"
log_errors = "1"
mail.add_x_header = "1"
mail.log = "/var/log/php_sendmail.log"
max_execution_time = "60"
max_file_uploads = "20"
max_input_nesting_level = "64"
max_input_time = "60"
max_input_vars = "1000"
mbstring.detect_order = "auto"
mbstring.encoding_translation = "0"
mbstring.func_overload = "0"
mbstring.http_input = "pass"
mbstring.http_output = "pass"
mbstring.http_output_conv_mimetype = "^(text/|application/xhtml\+xml)"
mbstring.internal_encoding = "UTF-8"
mbstring.language = "neutral"
mbstring.strict_detection = "1"
mbstring.substitute_character = None
memory_limit = "256M"
mysql.allow_local_infile = "1"
mysql.allow_persistent = "1"
mysql.cache_size = "2000"
mysql.connect_timeout = "60"
mysql.default_host = "localhost"
mysql.default_port = "3306"
mysql.default_socket = "/tmp/mysql.sock"
mysql.max_links = "-1"
mysql.max_persistent = "-1"
mysql.trace_mode = "0"
mysqli.allow_local_infile = "1"
mysqli.allow_persistent = "1"
mysqli.cache_size = "2000"
mysqli.connect_timeout = "60"
mysqli.default_host = "localhost"
mysqli.default_port = "3306"
mysqli.default_socket = "/tmp/mysql.sock"
mysqli.max_links = "-1"
mysqli.max_persistent = "-1"
mysqli.reconnect = "1"
mysqli.trace_mode = "0"
mysqlnd.collect_memory_statistics = "1"
mysqlnd.collect_statistics = "1"
mysqlnd.net_cmd_buffer_size = "2048"
mysqlnd.net_read_buffer_size = "32768"
;opcache.blacklist_filename =
opcache.consistency_checks = "0"
opcache.dups_fix = "0"
opcache.enable = "0"
opcache.enable_cli = "0"
opcache.enable_file_override = "1"
opcache.error_log = "/var/log/php_opcache.log"
opcache.fast_shutdown = "1"
opcache.force_restart_timeout = "180"
opcache.interned_strings_buffer = "8"
opcache.load_comments = "1"
opcache.log_verbosity_level = "2"
opcache.max_accelerated_files = "4000"
opcache.max_file_size = "0"
opcache.max_wasted_percentage = "5"
opcache.memory_consumption = "128"
opcache.optimization_level = "0xffffffff"
;opcache.preferred_memory_model =
opcache.protect_memory = "0"
opcache.revalidate_freq = "60"
opcache.revalidate_path = "1"
opcache.save_comments = "1"
opcache.use_cwd = "1"
opcache.validate_timestamps = "1"
output_buffering = "4096"
pcre.backtrack_limit = "8M"
pdo_mysql.cache_size = "2000"
pdo_mysql.default_socket = "/tmp/mysql.sock"
pgsql.allow_persistent = "1"
pgsql.auto_reset_persistent = "0"
pgsql.ignore_notice = "0"
pgsql.log_notice = "0"
pgsql.max_links = "-1"
pgsql.max_persistent = "-1"
post_max_size = "256M"
realpath_cache_size = "512000"
; register_argc_argv = "1"
; register_long_arrays = "on"
request_order = "GP"
sendmail_path = "/usr/sbin/sendmail -t -i "
session.bug_compat_42 = "0"
session.bug_compat_warn = "0"
session.cache_expire = "180"
session.cache_limiter = "nocache"
session.cookie_httponly = "1"
; session.cookie_lifetime = "0"
session.cookie_path = "/"
session.entropy_file = "/dev/urandom"
session.entropy_length = "32"
session.gc_divisor = "1000"
; session.gc_maxlifetime = "1440"
session.gc_probability = "1"
session.hash_bits_per_character = "5"
session.hash_function = "1"
session.name = "PHPSESSID"
session.save_handler = files
session.save_path = /data/tmp/php/session
session.serialize_handler = "php"
session.use_cookies = On
session.use_only_cookies = On
session.use_strict_mode = "1"
session.use_trans_sid = "0"
short_open_tag = "0"
soap.wsdl_cache_dir = "/data/tmp/php/wsdl"
soap.wsdl_cache_enabled = "1"
soap.wsdl_cache_limit = "5"
soap.wsdl_cache_ttl = "86400"
sql.safe_mode = "0"
sys_temp_dir = "/data/tmp/php"
sysvshm.init_mem = "10000"
upload_max_filesize = "256M"
upload_tmp_dir = "/data/tmp/php/uploads"
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry,fieldset="
user_ini.filename = None
variables_order = "GPCS"
zend.enable_gc = "1"
zlib.output_compression = "0"
Last edited by Proteus on 2014-03-27 17:03, edited 2 times in total.
LG
Proti

https://phoenix-blog.de

"Die Kamera wird bei hohen ISO Werten aber rauschen. Nichts ahnend hielt er sich die Kamera ans Ohr!"

User avatar
Joe User
Project Manager
Project Manager
Posts: 11578
Joined: 2003-02-27 01:00
Location: Hamburg

Re: FreeBSD Web Hosting System php.ini

Post by Joe User » 2014-03-27 19:20

Wie lauten denn die Fehlermeldungen in den Logs?
/var/log/php_error.log
/data/www/vhosts/.../logs/error_log
Hat Euer Script einen Debug-Modus? Falls ja, bitte mal einschalten.

Kurz und flüchtig über https://github.com/dmecke/JpGraph/blob/ ... pgraph.php und Google geschaut, sagen beide, dass das Script die Daten nicht finden/verarbeiten kann. Also bitte nochmal alle Pfadangaben in der Scriptconfig kontrollieren (unter Anderem ist der TEMP-Pfad in der php.ini auf /data/tmp/php gesetzt).
PayPal.Me/JoeUserFreeBSD Remote Installation
Wings for LifeWings for Life World Run

„If there’s more than one possible outcome of a job or task, and one
of those outcomes will result in disaster or an undesirable consequence,
then somebody will do it that way.“ -- Edward Aloysius Murphy Jr.

User avatar
Proteus
Posts: 272
Joined: 2013-04-14 05:08
Location: Holzgerlingen

Re: FreeBSD Web Hosting System php.ini

Post by Proteus » 2014-08-30 03:13

Ups Sorry ich habe den Beitrag total vergessen. Wir haben damals die Standard php.ini hergenommen und entsprechend modifiziert und deine Einwände einfließen lassen. Der Beitrag kann als Gelöst betrachtet werden! ;)
LG
Proti

https://phoenix-blog.de

"Die Kamera wird bei hohen ISO Werten aber rauschen. Nichts ahnend hielt er sich die Kamera ans Ohr!"