So I just switched from some network solutions hosting running some php files that return JSON. when I run the same curl terminal command to the new server it does not respond the php errors like it did before. What do I need to do to enable it so it returns the errors in the terminal with curl?
Update it appears it's returning a HTTP Error 500. How can I show the errors instead?
I figured it out, i edited /etc/php.ini to display_errors = On;
Related
i AM USING A aws lightsail instance with a Bitnami Apache2 Lampstack setup on it.
My issue is I am unable to get php curl enabled. I seem to have a bunch of php.ini files all over the server in diffiferent locations. So I edited all of them removing the ; from the line that read extension=curl. I then restarted the instance. However my php file is still giving me the error saying
caught Exception: Shippo needs the CURL PHP extension.
When I run a phpinfo() I see my path to the ini file is /etc/php/8.0/apache2/php.ini
However when I do a which php command I am giving a path like this /opt/bitnami/php/bin/php
when I do a php -v I am also seeing it say PHP 7.4.27 so my php info file seems to say I am using php7.8 and my CLI feels i am using php7.4 which could be part of my issue.
Any suggestions on how to fix this? my other issue is I am having a hard time getting to the path /etc/php/8.0/apache2/php.ini I simply can not find a folder with 8.0 in it
I am getting a blank screen and nothing in the error logs for a php program I am trying to get up and running (it happens to be yourls). What do I need to do to get error logging enabled or to otherwise get an indicate of why the page is not loading (I know there are multiple postings on this but none of the fixes suggested in this posts seems to generate any output and don't seem to work for this specific implementation)?
I'm running php from this install: php-8.0.0-nts-Win32-vs16-x64.zip
I'm running Apache HTTPD from this install: httpd-2.4.46-o111i-x64-vc15.zip
Turns out this was a behavior of the yourls software I was trying to run. It had a flag that turned error logging/messaging off AND it was not compatable with php 8. I switched to php 7 and switched to the php.ini-development config (by renaming it to php.ini) and I am now seeing error messages (the driver for the database is missing).
I have a problem accessing a mongoDB database using the PHP driver.
When I locally run the following code:
<?php
echo "Connecting";
$manager = new MongoDB\Driver\Manager("mongodb://localhost:28124");
echo "Connected";
?>
it works.
However, when I access this php file remotely from the browser, I only see "Connecting" and then the web page hangs with internal server error 500.
I'm running with:
PHP 5.6.25 (cli)
MongoDB: 1.1.8
Apache: 2.2.22
Any ideas?!?!?!?
There is no way of tracing the problem without logs.
Please check your default log, which should be in "/var/log/httpd/error_log" or "/var/log/apache2/error.log" (custom logs might not get all the info) and provide specifics.
If you are not getting anything from the logs, please retry after turning PHP logging on.
In php.ini(of apache dir):
Remove semicolon from in front of below lines
;display_errors
;display_startup_errors
;error_reporting
Set the values to
display_errors = On
display_startup_errors = On
error_reporting = E_ALL
Restart the server, run script, on error, check the logs again.
Note: Reset the php.ini to default values after you are done. Error logging adds significant overhead to execution.
How to stop the code from completing the redirect if a PHP notice error happens? When working on Ubuntu local LAMP for development some notice errors are missed! But those same errors on the live server stops the header redirects.
What I am trying to do is catch those errors on the the local development server before they show up on the live server. How can I accomplish this? - headers already sent))?
Notice Errors:
Change this line in your php.ini in your Ubuntu server, and restart the web service:
output_buffering = 4096
to
output_buffering = Off
Alternatively, call ob_end_flush() before doing anything else in your Ubuntu server, but that makes the code inconsistent with the other environment.
I'm confused about where I should be looking for a log file containing php errors on a Windows 2008 Server running IIS 7.5 (I'm more familiar with the Mac OS X setup for this).
In my php.ini file I have log_errors set to "On" but I'm not seeing any php errors in the IIS logs that appear in this folder:
C\inetpub\logs\LogFiles
Is it possible to have the php errors included in this file or do I need to specify a new file just for php errors?
(I'm trying to troubleshoot a site that is generating 500 – Internal server error for a php error. I've found this site http://www.webdigi.co.uk/blog/2009/php-on-windows-server-2008-500-internal-server-error-on-iis/ that explains how I can view the error when accessing the page via an RDP session on the server, but I need to be able to log these and view the log as I won't always have RDP access).
In the php.ini (you can find this under "c:\program files (x86)\php\{PHP Version}") change these settings:
log_errors = On
Then set error_log to syslog for the windows event log:
error_log = syslog
Or specify a location on disk such as:
error_log = C:\Windows\temp\php_errors.log
Make sure that the error_log or log_error values aren't being set elsewhere in the file.
If you are using xampp in windows. The error log can be find in
cd C:\xampp\apache\logs\
Use the following command to display the latest errors
tail -f .\error.log