php , apache server error, cant trace - php

OK The server encountered an internal error or misconfiguration and
was unable to complete your request. Please contact the server
administrator, admin#example.com and inform them of the time the error
occurred, and anything you might have done that may have caused the
error. More information about this error may be available in the
server error log.
I get this message everytime I run the code. I have no idea where the error is.. I checked through the apache error file, and some other error log files..and found nothing about the mistake..how do I trace the errror
I think that is the error that I see:
> [8/27/2012 12:28:57 PM] Error: PHP process 35344 from the "application/x-httpd-php" pool has exited with status 255.
[8/27/2012 12:28:57 PM] Error: Read data error - unable to get read result. Code 109.
[8/27/2012 12:28:57 PM] Error: Request for C:/Program Files (x86)/Zend/Apache2/htdocs/backlinks/cron/links-buy.php: Unable to get the response from PHP process
Thats what I see in the event viewer:
> php-cgi.exe
> 5.3.9.0 4ef33bca ZendOptimizerPlus.dll
> 0.0.549.0 4f00c7dd c0000005 000061a1 8554 01cd8436d2089924 C:\Program Files
> (x86)\Zend\ZendServer\bin\php-cgi.exe C:\Program Files
> (x86)\Zend\ZendServer\lib\optimizerplus\php-5.3.x\ZendOptimizerPlus.dll
> 112872b4-f02a-11e1-aed2-8c89a53c9045

Add die(); in the middle of your code. Try it. If error still occurs your error in first part. Then divide your error part ino two by die(); and so on.

Open your php file. It seems to be the file /Zend/Apache2/htdocs/backlinks/cron/links-buy.php. Determine a location on your file system where to write your PHP error output. E.g. use '/home/myuser/public_html/phpDebugErrorLog.txt'. Replace this path!
Add many statements like this to your PHP file (consider the syntax of PHP). Add different numbers 1, 2, 3, ....., 100 .
error_log('Position 1: ' . chr(13), 3, '/home/myuser/public_html/phpDebugErrorLog.txt');
some PHP code here;
error_log('Position 2: ' . chr(13), 3, '/home/myuser/public_html/phpDebugErrorLog.txt');
some more PHP code;
error_log('Position 3: ' . chr(13), 3, '/home/myuser/public_html/phpDebugErrorLog.txt');
So you determine the position in your PHP file where the error happens which crashes your CGI PHP script. The last line which is shown in your error log file will give you the position in the file which has the bug. Then fix the bug in PHP.

Related

GuzzleHttp\Exception\RequestException: cURL error 0 -- IIS -- Windows 10 -- PHP V 7+

Enabled app insights on php project, it is working on host machine. However, during running the same code on local box getting following error: [seems some IIS config issue or update not sure]
Fatal error: Uncaught GuzzleHttp\Exception\RequestException: cURL error 0: The cURL request was retried 3 times and did not succeed. The most likely reason for the failure is that cURL was unable to rewind the body of the request and subsequent retries resulted in the same error. Turn on the debug option to see what went wrong. See https://bugs.php.net/bug.php?id=47204 for more information. (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) in ....\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 186
and
Warning: curl_setopt_array(): Unable to create temporary file. in ....\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php on line 56
Trace:
trace while running an application from IIS
check the plugins and look through the debug.log file in wp-content and most likely it is a plugin that is causing this issue. I found that Mailjet causes this issue when unconfigured. Simply activate the plugins found in the error log and this will help solve it. The Microsoft version of cURL in PHP will throw the error and the Linux variant will not.

Prestashop installation on server giving Internal server error 500

Having the same problem while installing the latest Prestashop on my server. So as #Agnes Tom has recommended, I changed the define.inc.php file and this is the error it´s showing up:
Warning: session_start(): open(/var/php_sessions/sess_b3c24487f16e9dcc7ebe9b0897bee69f, O_RDWR) failed: No such file or directory (2)
in /hermes/bosnaweb14a/b1900/ipw.danarostocom/public_html/zumashoes/install/classes/session.php on line 47 Notice: Use of undefined constant _NEW_COOKIE_KEY_ - assumed '_NEW_COOKIE_KEY_'
in /hermes/bosnaweb14a/b1900/ipw.danarostocom/public_html/zumashoes/classes/Cookie.php on line 79 Fatal error: Uncaught exception 'Defuse\Crypto\Exception\BadFormatException' with message 'Encoding::hexToBin() input is not a hex string.'
in /hermes/bosnaweb14a/b1900/ipw.danarostocom/public_html/zumashoes/vendor/defuse/php-encryption/src/Encoding.php:65 Stack trace:
#0 /hermes/bosnaweb14a/b1900/ipw.danarostocom/public_html/zumashoes/vendor/defuse/php-encryption/src/Encoding.php(164): Defuse\Crypto\Encoding::hexToBin('_NEW_COOKIE_KEY...')
#1 /hermes/bosnaweb14a/b1900/ipw.danarostocom/public_html/zumashoes/vendor/defuse/php-encryption/src/Key.php(38): Defuse\Crypto\Encoding::loadBytesFromChecksummedAsciiSafeString('\xDE\xF0\x00\x00', '_NEW_COOKIE_KEY...')
#2 /hermes/bosnaweb14a/b1900/ipw.danarostocom/public_html/zumashoes/classes/PhpEncryptionEngine.php(112): Defuse\Crypto\Key::loadFromAsciiSafeString('_NEW_COOKIE_KEY...')
#3 /hermes/bosnaweb14a/b1900/ipw.danarostocom/public_html/zumashoes/classes/PhpEncryptionEngine.php(46): PhpEncryptionEngineCore::loadFromAsciiSafeString('_NEW_COOKIE_KEY...')
#4 /hermes/bosnaweb14a/b1 in /hermes/bosnaweb14a/b1900/ipw.danarostocom/public_html/zumashoes/vendor/defuse/php-encryption/src/Encoding.php on line 65
Warning: Unknown: open(/var/php_sessions/sess_b3c24487f16e9dcc7ebe9b0897bee69f, O_RDWR) failed: No such file or directory (2) in Unknown on line 0
Warning: Unknown: Failed to write session data (files).
Please verify that the current setting of session.save_path is correct (/var/php_sessions) in Unknown on line 0
Might anyone helping me to know how to solve this error??
Thank you for your time
It's throwing an error saying it can't find or write to '/var/php_sessions/'
Do you have full access to the server?
If so, check if that folder exists and if the user or web server has permission to write to it, or change in php.ini
session.save_path = "/var/php_sessions"
To something like :
session.save_path = "/home/user/sessions"
Again, must be an existing folder with read/write permissions for the user or web server (this depends if you run the web server as own user or as account user).
If it's a shared envoirement, you better contact you hosting provider. Some allow you to have a php.ini in your hosting root and you could use it to change the session.save_path, others ignore it.
How to recognize the Error 500
First, we need to go over the different ways you might see this error message on your computer. There are different forms of this message because each host/server is allowed to customize the way it’s displayed. Here are some common ways you might see this error.
“500 Internal Server Error”
“HTTP 500 – Internal Server Error”
“Internal Server Error”
“HTTP 500 Internal Error”
“500 Error”
“HTTP Error 500″
Most times you will see this message accompanied by various forms of this classic ambiguous line
“The server encountered an unexpected condition that prevented it from fulfilling the request by the client”
It’s important to note that this error can be shown on any browser and any operating system (sorry, but switching to the new Mac Pro will not solve this problem) Here is a screenshot of one of the ways this error might be displayed on your browser.
Internal error server
What is the 500 Error?
Put simply, the 500 error is the Web servers way of saying “Something went wrong but I can’t tell you what, sorry.” This is what we call a “server-side” error. That means that there is something wrong with the server who is hosting the website. It is an extremely general error usually caused by configuration issues with the websites programming, PHP or system permissions.
How Can I Troubleshoot?
Don’t fret; although this error message is absurdly vague, you still have ways to find more information. Web servers are almost always configured to hide specific error messages. If your PrestaShop store is suffering from this debilitating error, you can turn on PrestaShop’s Error Reporting from FTP or your hosting’s CPanel to get more details.
There are two ways to turn on Error Reporting in PrestaShop depending on what version you have.
For PrestaShop v1.4 through v1.5.2
Open config/config.inc.php
On or around line 29 you will find this line
#ini_set('display_errors', 'off');
Change that line to read
#ini_set('display_errors', 'on');
For PrestaShop v1.5.3+
Open config/defines.inc.php
On or around line 28 you will find this line
define('_PS_MODE_DEV_', false);
Change that line to read
define('_PS_MODE_DEV_', true);
Once you enable error reporting through your FTP or CPanel, you can navigate back to your PrestaShop’s front or back office and reproduce the error or issue you are having. For example, if you are not able to access your website because of the 500 error, you will need to turn on error reporting and refresh the page(s) that had the error. There will be additional information that you can use to investigate the problem.
Investigating the Error
Once you have the additional information, there are some standard ways to further investigate the error. First, let’s go over some the most common ways this problem is caused. Once we find the cause of this error, it is much easier to solve.
Permissions: Many times you will find that the permission setting on one of your folders is set incorrectly. It could be a simple fix as switching a file/folder permission from 777 to 755 or vice versa. In most cases permission sets of 777 are extremely unsafe and can allow even an amateur hacker to access your files and put malicious code in it. Make sure to check with your hosting provider for specific information about permissions set as some servers have different regulations.
Incorrectly configured .htaccess: Oftentimes you will receive an internal server error when the htaccess file is configured incorrectly. For PrestaShop purposes, the main culprits of the htaccess errors are “URL Rewrite” settings or Friendly URL enabling. The htaccess syntax is very strict so even one wrong character or command will cause the server to return an Internal Error 500. Make a backup of your htaccess and regenerate the htaccess file either through the back office or by toggling the Enable Friendly URL option.
Server timeout: Every server has their own timeout setting, which sets the time that any given script can run. If the function or script crosses that limit, you will receive an error 500. The most common scripts in PrestaShop that can take too long to load are CSV Imports, backups, translation loading, import/exports and thumbnail regeneration. Many times the server limit is 30 seconds, which is not long enough to run these scripts. You should contact your hosting provider and inquire about changing the limit, at least temporarily.
Now, if the problem is not solved by investigating these common causes, you should also take a look at the Apache and PHP Error logs. These are provided by your hosting provider but sometimes you will need to contact them directly in order to have access to these log files.

Lua error - MediaWiki templates

After installing Scribunto (adding the extension to the folder and adding in LocalSettings the following code:)
require_once "$IP/extensions/Scribunto/Scribunto.php";
I have imported the Template:Infobox and Module:Infobox (along with the ones which come with those), and after testing a basic infobox I received the Script error -
Lua error: Internal error. Error reading from pipe.
Afterwards, I have done some research and I added the following line (in LocalSettings):
$wgScribuntoEngineConf['luastandalone']['luaPath'] = '/binaries/lua5_1_4_Win64_bin/';
Then, the Script error changes to:
Lua error: Internal error: The interpreter exited with status 1.
I use Windows 10. How can I fix this?

PHP only showing 500 error

Hello everyone I am new to PHP and discussing my problem with a simple example
I have a code on my file index.php
<?php
echo $a;
?>
When I run this code on my local server it show me the error-
Notice: Undefined variable: a in D:\My website\index.php on line 5
But when I host this file on server and run then it show following error-
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
Why its not showing actual error as it show on my local server ?
This error comes from the web server, not from PHP.
It seems (google search) that the message "There is a problem with the resource you are looking for, and it cannot be displayed" is coming from IIS, the web server of Microsoft.
IIS must be configured to be able to execute PHP files.
You can read about this configuration here

Error not displaying in PHP

Why can't I see what the Error is. On youtube, when they forgot to put in a ; an error along with which file and which line on that file was displayed. When I get an error, I just get:
Server Error
500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed.
How do I get it to show what the error is?
I think that is a server error, and not a php error, but in your php.ini file towards the bottom and not in the examples, there are error reporting options. Be sure you change them back to no, after the error is corrected, this is a security measure to keep your code private.
As far as a 500 error, check your apache logs.

Categories