phpinfo.php文件是一个包含了大量PHP配置信息的简单文本文件,通过查看这个文件,我们可以了解到服务器的许多配置信息,例如PHP版本、操作系统、服务器软件等等,这对于了解服务器环境、排查问题以及优化配置都有很大的帮助,本文将详细介绍如何查看PHP主机空间或服务器的配置信息,并提供一些实用的技巧和建议。
1. 查看PHP版本
在phpinfo.php文件中,我们可以找到PHP的版本信息,这些信息会在`General Configuration`部分的最后一行显示。
PHP Version 7.2.0-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Mar 3 2020 15:59:56) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.0-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies with Xdebug CDN.6.0beta3, Copyright (c) 2003-2020, by Derick Rethans
这里我们可以看到服务器上的PHP版本是7.2.0,由Zend Technologies开发。
2. 查看操作系统信息
在phpinfo.php文件中,我们还可以找到服务器的操作系统信息,这些信息通常在`Operating System Information`部分显示。
OS: Linux dvkid 4.15.0-54-generic #58-Ubuntu SMP Tue May 8 19:55:34 UTC 2019 x86_64 Kernel: Linux kernel version 4.15.0-54-generic on #58-Ubuntu SMP Tue May 8 19:55:34 UTC 2019 x86_64 Architecture: x86_64 CPU opset: 64bit Byte Order: little endian CPU(s): 4 Core(s) per socket: 2 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 78 Model name: Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz Stepping: 3 CPU MHz: 1600.000 CPU max MHz: 3600.0000 CPU min MHz: 800.0000 BogoMIPS: 3785.97 Virtualization:VT-x L1d cache: 32K L1i cache: 32K L2 cache: 256K L3 cache: 3072K NUMA node0 CPU(s): 0-3 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb wbnoinvd arat pln pts ymml extd hypervisor lahf_lm aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est npt state popcnt tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsave avx nonstop_tsc powerpcle xsaveopt pln pts hwp hwpstate epb intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc odpnetmisc_leak pni pclmulqdq dtes64 monitor ds_cpl cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_adjust aesni_shader asimdrv_shader flush_l1d
这里我们可以看到服务器的操作系统是Ubuntu,内核版本是4.15.0-54-generic,处理器是Intel Core i5-7200U。
3. 查看服务器软件信息
在phpinfo.php文件中,我们还可以找到服务器上安装的软件信息,这些信息通常在`Server API Localhost`部分显示。
Apache/2.4.7 (Ubuntu) Server version unknown, mod_fcgid/2.3.9, OpenSSL/1.0.2h PHP/7.2.0 with Suhosin-Patch modus operandi minimorum Compiled with warnings into /usr/local/apache2/htdocs on Thu, 09 Apr 2019 at 16:57:59 -0700, reachable by HTTPS request, port = 443, URL rewriting is enabled, server name = www.example.com, ServerAdmin webmaster@localhost, User www-data, Group www-data, ErrorLog logs/error_log, CustomLog logs/access_log combined, ServerSignature On, Client support available, FrontPage enable_dir browsing, Language en uml uno localized resources modifiable en us tr codec lto ansi serbian colombian portuguese czech korean (en) polish (pl) spanish (es) finnish (su) dannish (fi) italian (it) dutch (nl) welsh (cy) norwegian bokmål icelandic vietnamese geopolitical nato/iso country ctype gzip text/plain application/x-javascript image/png image/jpeg text/xml application/xml application/rss+xml application/atom+xml */* q=0.8 accept = text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 robots = disallowed/*;q=http://www\.google\.com/bot\.html */, referer = http://localhost/wordpress/?doing_wp_cron = false https://www\.google.com/bot\.html /images/logo googlebot-logo-color-dark nextgen-theme colorbox link images media queries mobile responsive design video audio icons favicon type of output other...
原创文章,作者:K-seo,如若转载,请注明出处:https://www.kdun.cn/ask/87014.html