PHPInfo | Get the output of phpinfo as an array | Runtime Evironment library
kandi X-RAY | PHPInfo Summary
kandi X-RAY | PHPInfo Summary
A simple PHP library to get the output of phpinfo() as an array when invoked from a command line script. You can submit a PR if you adapt it to the HTML version. Although by now you can compile the information to a reasonable degree of completeness from other functions, so this will be of use only when you absolutely have to parse phpinfo().
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Parse a single text block
- Parse phpInfo string
- Parse text blocks
- Get parsed data
- Sets text content .
- Set the php info
- Parse the HTML Info
PHPInfo Key Features
PHPInfo Examples and Code Snippets
Community Discussions
Trending Discussions on PHPInfo
QUESTION
I want to add more security to my website by adding anti cross site scripting (XSS) security measures.
I am trying to set the headers in my .htaccess file to include the required headers to protect against XSS and clickjacking.
But when I add the headers they are not reflected in my website when I check the network tab in my website.
I also tried adding the headers to my header.php file that I have included in all of my .php files in my website, yet the headers are sent not being sent or shown in the network tab.
Here is my code:
.htaccess file:
...ANSWER
Answered 2022-Mar-28 at 12:27I found the issue to be that headers are already being sent
error, and the fix for that was to remove the white space before the opening of the php tag in the beginning of my file.
previous code causing the error:
QUESTION
I have installed Xdebug on a Ubuntu 20.04 system. I followed this documentation , which I found to be quite well written, and got everything installed per the specs. (I used apt rather than yum, and placed the .so file into /usr/lib/php/20190902
folder rather than the document's example.)
In that document, there is a reference to adding to the php.ini file (I added to /etc/php/7.4/apache2/php.ini
and /etc/php/7.4/cli/php.ini
files). Since the article doesn't specifically mention "sections" of the .ini file, I put them within the [PHP]
section. (This is consistent with the remark about putting right before the Quick Reference bit.) I restarted Apache2 and the phpinfo()
output now includes Xdebug, which it did not include before. All well and good.
The trouble I'm having is that although I set xdebug.mode = debug
in the php.ini files, the phpinfo()
output tells me that xdebug.mode
is set to develop
. Consequently, Step debugger shows as Disabled in my configuration. I cannot see why.
These are the lines I've added to each of those php.ini files:
...ANSWER
Answered 2022-Mar-22 at 00:04zend_extension="/usr/lib/php/20190902/xdebug.so
(that has an extra "
).
In any case, it is very likely that there is either another xdebug.mode
line somewhere, or a different INI file is being used. Try to see what the output of xdebug_info()
tells you — it also mentions which INI files have been read.
QUESTION
So first of all since October for some reason my previously working Xdebug config for VSCode + Docker stopped working.
I switched over to an Xdebug 3 config to try it out, since 2.9 appears to have stopped working for me. Maybe because of a VSCode or PHP Debug plugin update?
But so far I have been unable to get it working or get it working only half?
VSCode launch.json:
...ANSWER
Answered 2022-Jan-11 at 12:58If you are using vscode IDE, than check your port in launch.json file. keep it 9000 and restart your vscode.
you can copy launch.json file from here.
QUESTION
Created .test.php file with one line of code:
...ANSWER
Answered 2022-Feb-26 at 06:08There might be different settings of your PHP environment used in Command Line Interpreter/Interface CLI
vs Common Gateway Interface CGI
.
First compare what .ini
files are loaded in both environment, ie.
- for
CLI
runphp -i
- for
CGI
create a filephpinfo.php
with only contentand open it in the web browser.
Compare the results and see what modules
are loaded and/or what .ini
files are loaded.
QUESTION
My development environment is a VirtualBox Debian VM running on Windows with Apache and PHP. I currently access it in the browser using a specific local IP 192.168.33.10. I've created these two simple test scripts:
stest1.php:
...ANSWER
Answered 2022-Feb-16 at 22:12Unconditionally calling session_start()
does exactly what it says: it starts a new session without any if or then; always check for the session ID first.
Also make sure, that the cookie-domain has been set up properly (this value might not match). For reference: setcookie()
.
QUESTION
I am running scripts that last longer than the limit allowed by the server and the server does not terminate them.
The phpinfo()
showed me that the max_execution_time
is set to 30.
Using the ini_get('max_execution_time')
feature the value 30 is displayed, but I put the code with sleep(45)
and it runs until the end.
I also tried decreasing the time with ini_set('max_execution_time', 15)
, but still the code runs normally with sleep(45).
I've used sleep
for testing purposes, but this is with functions that use cURL or even foreach
and while
that are used to create files for users.
What could be changing the server's maximum execution time?
...ANSWER
Answered 2022-Feb-16 at 18:12"The set_time_limit() function and the configuration directive max_execution_time only affect the execution time of the script itself. Any time spent on activity that happens outside the execution of the script such as system calls using system(), the sleep() function, database queries, etc. is not included when determining the maximum time that the script has been running."
Copied from: sleep().
In other words: Sleep()
was a bad choice for testing maximum execution time.
QUESTION
After upgrading my php version from 5.6 to 7.4, and revising my .htaccess file to acknowledge the new version, my html page is not processing its php code. In other words, the php code itself is output instead of its intended calculations. All php code worked fine before the version upgrade.
In the revised .htaccess file, version 7 replaced version 5 in the AddHandlers. Using phpinfo I checked to see if the php version was in fact correct. It was correct.
I know the code on my page is correct because it runs as it should when that page uses a .php extension in place of the .html extension. It worked fine prior to the version upgrade. What is wrong with my revised .htaccess? First, here is my revised .htaccess file:
...ANSWER
Answered 2022-Jan-29 at 21:35Jan's suggestion was the solution. To repeat what they said:
I noticed your custom AddHandler statements use a different MIME type from the one apparently auto-generated by cPanel, have you tried using application/x-httpd-ea-php74
QUESTION
I have a strange problem in a symfony 5.3.10 app and i can't wrap my head around it.
If I trigger a 500 error, like so:
...ANSWER
Answered 2022-Feb-10 at 16:28This is not a Symfony error (nor a PHP error for that matter).
On PHP 7.4, trying to output an undefined variable would only raise a notice, not a fatal error (code 500). Notices are silently swallowed up by the engine unless you configure your server to log them or output them, where you'd get something like:
Notice: Undefined variable: a in file xxx.php line Y
A try
/catch
won't do anything for you, since no exception is thrown for you to catch.
Even on PHP 8 or 8.1, this will only raise a warning like:
Warning: Undefined variable $a
You can see the result under version < 8 and >= 8 here.
QUESTION
I have a problem with Xdebug on Mac OS using Big Sur. Below, I will explain what is happening.
- When I run
phpinfo()
- I don't see a Xdebug section at all. - When I run commands such as
xdebug_call_file()
it throws aPHP Fatal error: Uncaught Error: Call to undefined function
error.
Here are all the configurations:
php -v
:
PhpStorm shows that Debugger is active:
php.ini
(/usr/local/etc/php/8.0/php.ini) has these configurations:
ANSWER
Answered 2022-Jan-27 at 05:45
develop
: Enables Development Helpers including the overloaded var_dump(). https://xdebug.org/docs/all_settings#mode
xdebug.mode=debug,develop
QUESTION
I need the Event library for my project in PHP. The main project is running on a raspberry pi but I'm writing and testing the code completely on my Windows PC. To run the PHP code, I use the XAMPP.
I tried to import the Event extension within my code but in the command window, I keep getting the same error:
...ANSWER
Answered 2021-Dec-17 at 09:12The same error is displayed if the extension DLL was compiled for a different version of PHP.
Using Windows Explorer, right-click on the DLL and select properties, then Details. Check the Product version value.
The actual issue is that PHP extensions have an API version such as 20200930. The API version must match PHP and the extension. The CLI command php -i | grep API will display this information.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install PHPInfo
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page