Skip to content

Commit bf33da3

Browse files
committed
refactor: modernize PHP configuration with updated Xdebug settings
Updates the PHP configuration file to remove deprecated Xdebug settings and NetBeans-specific configuration which is no longer commonly used. The revised configuration focuses on modern IDE support, particularly for VSCode and PHPStorm, and aligns with Xdebug 3's configuration format. This change simplifies the configuration while maintaining compatibility with contemporary development environments.
1 parent aaadd1a commit bf33da3

File tree

1 file changed

+50
-23
lines changed

1 file changed

+50
-23
lines changed

etc/php/php.ini

+50-23
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,56 @@
11
; PHP Configuration
22

3-
;[Date]
4-
; Defines the default timezone used by the date functions
5-
; http://php.net/date.timezone
6-
;date.timezone =
3+
[PHP]
4+
; Timezone setting
5+
date.timezone = UTC
76

8-
; Error handling
9-
;display_errors = Off
7+
; Error reporting settings
8+
display_errors = On
9+
error_reporting = E_ALL
10+
log_errors = On
11+
error_log = /var/log/php/php_errors.log
1012

11-
; Xdebug
12-
; See https://xdebug.org/docs/all_settings
13+
; Memory limits
14+
memory_limit = 256M
15+
upload_max_filesize = 20M
16+
post_max_size = 20M
17+
max_execution_time = 60
1318

14-
;PHPStorm
19+
; Security settings
20+
expose_php = Off
21+
session.cookie_httponly = 1
22+
session.use_only_cookies = 1
23+
session.cookie_secure = 1
24+
25+
; Opcache settings for performance
26+
opcache.enable = 1
27+
opcache.memory_consumption = 128
28+
opcache.interned_strings_buffer = 8
29+
opcache.max_accelerated_files = 4000
30+
opcache.revalidate_freq = 2
31+
opcache.fast_shutdown = 1
32+
opcache.enable_cli = 1
33+
34+
; Xdebug 3 configuration
1535
[Xdebug]
16-
xdebug.remote_enable=1
17-
xdebug.idekey=PHPSTORM
18-
xdebug.profiler_enable=0
19-
xdebug.max_nesting_level=700
20-
xdebug.remote_host=192.168.0.1 # your ip
21-
xdebug.remote_port=9000
22-
23-
;Netbeans
24-
;[Xdebug]
25-
;xdebug.remote_enable=1
26-
;xdebug.remote_handler=dbgp
27-
;xdebug.remote_mode=req
28-
;xdebug.remote_host=192.168.0.1 # your ip
29-
;xdebug.remote_port=9000
36+
; Basic settings
37+
xdebug.mode = debug,develop
38+
xdebug.start_with_request = yes
39+
xdebug.discover_client_host = true
40+
xdebug.client_port = 9003
41+
42+
; Use the following line if auto-discovery doesn't work
43+
;xdebug.client_host = host.docker.internal
44+
45+
; IDE integration
46+
;xdebug.idekey = VSCODE
47+
xdebug.idekey = PHPSTORM
48+
49+
; Output settings
50+
xdebug.cli_color = 1
51+
xdebug.var_display_max_depth = 5
52+
xdebug.var_display_max_children = 256
53+
xdebug.var_display_max_data = 1024
54+
55+
; Performance settings
56+
xdebug.max_nesting_level = 256

0 commit comments

Comments
 (0)