Wordpress Vs Fcgid - 500 internal server error - wordpress

I am using wordpress application with multisite concept. Also my web hosting working with mod_fcgid as a server API. At some instances the my site getting 500 internal server error. When I looked into the error log, it shows the repeated warning errors like "[warning] mod_fcgid: stderr: PHP Warning: Creating default object from empty value in /var/www/vhosts/mywjb.com/httpdocs/wp-includes/ms-load.php on line 113". How do I resolve this problem. Can any one help?
Thanks in advance,

My Web server was working with FCGI mode. So the FCGI processing with multiple PHP requests (wordpress), and the apache logging the FCGI related errors, when the requests gets failed with FCGI.
Below is my wordpress code,
111 global $wpdb, $current_site, $domain, $path, $sites, $cookie_domain;
112 if ( defined( 'DOMAIN_CURRENT_SITE' ) && defined( 'PATH_CURRENT_SITE' ) ) {
113 $current_site->id = defined( 'SITE_ID_CURRENT_SITE' ) ? SITE_ID_CURRENT_SITE : 1;
.........
I have fixed this issue by shifting the server mode from FCGI to CGI.
But compared to CGI, working with FCGI only most efficient and performance boosting technology.
Thanks

Related

Error while trying to send logs with rsyslog without local storage

I'm trying to send logs into datadog using rsyslog. Ideally, I'm trying to do this without having the logs stored on the server hosting rsyslog. I've run into an error in my config that I haven't been able to find out much about. The error occurs on startup of rsyslog.
omfwd: could not get addrinfo for hostname '(null)':'(null)': Name or service not known [v8.2001.0 try https://www.rsyslog.com/e/2007 ]
Here's the portion I've added into the default rsyslog.config
module(load="imudp")
input(type="imudp" port="514" ruleset="datadog")
ruleset(name="datadog"){
action(
type="omfwd"
action.resumeRetryCount="-1"
queue.type="linkedList"
queue.saveOnShutdown="on"
queue.maxDiskSpace="1g"
queue.fileName="fwdRule1"
)
$template DatadogFormat,"00000000000000000 <%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% - - - %msg%\n "
$DefaultNetstreamDriverCAFile /etc/ssl/certs/ca-certificates.crt
$ActionSendStreamDriver gtls
$ActionSendStreamDriverMode 1
$ActionSendStreamDriverAuthMode x509/name
$ActionSendStreamDriverPermittedPeer *.logs.datadoghq.com
*.* ##intake.logs.datadoghq.com:10516;DatadogFormat
}
First things first.
The module imudp enables log reception over udp.
The module omfwd enables log forwarding over (tcp, udp, ...)
So most probably - or atleast as far as i can tell - with rsyslog you just want to log messages locally and then send them to datadog.
I don't know anything about the $ActionSendStreamDriver tags, so I can't help you there. But what is jumping out is, that in your action you haven't defined where the logs should be sent to.
ruleset(name="datadog"){
action(
type="omfwd"
target="10.100.1.1"
port="514"
protocol="udp"
...
)
...
}

Wordpress wp_schedule_event localhost cURL error 7

I'm trying to schedule a simple event that should clear a transient daily at 23:59 UTC.
While investigating, I installed WP Crontrol as a debugging means. And noticed that my events were successfully added to the CRON custom events job task but were not firing, additionally I noticed the following error statement from WP Crontrol:
There was a problem spawning a call to the WP-Cron system on your site. This means WP-Cron events on your site may not work. The problem was:
cURL error 7: Failed to connect to localhost port 8080: Connection refused.
More information
I'm currently assuming that this is due to the fact that I'm developing on localhost.
Did anyone already encountered that type of issue, and what were the steps you took to fix it?
Just in case, following are my current scheduled event related functions.
/**
* Daily users_online transient clear
*/
if (! wp_next_scheduled ( 'wp_schedule_event_delete_transient_users_online' ) ) {
wp_schedule_event( strtotime( '23:59:00' ), 'daily', 'wp_schedule_event_delete_transient_users_online' );
};
add_action( 'wp_schedule_event_delete_transient_users_online', 'delete_transient_users_online' );
if ( ! function_exists( 'delete_transient_users_online' ) ) {
function delete_transient_users_online() {
delete_transient( 'users_online' );
};
};

Running WireMock server as a stand alone

I am trying to set up a mock server using wireMock as a standalone process. I downloaded the jar file and executed the following command:
java -jar wiremock-standalone-2.23.2.jar --port 0
I had to dynamically determine a port because I am already using the default 8080 port for another program running on my machine. It gave me the port number 55142, but when I tried accessing that on the web, it gave me the following error:
HTTP ERROR 403
Problem accessing /__files/. Reason:
Forbidden
Powered by Jetty://
It's probably due to the fact that you just entered http://localhost:55142
and as there are no mappings in ./mappings directory and files in ./files directory (the same where you have your wiremock.jar file is located)
2019-06-04 00:10:58.890 Request was not matched as there were no stubs registered:
{
"url" : "/"
...
}
please try call with __admin endpoint to see if WireMock is working
http://localhost:55142/__admin
please see also docs here for more nice admin commands.

how to debug symfony error "Untrusted Host" in production

problem :
Running symfony 3.4, I just preemptively took a look at symfony's logs and seen some strange errors :
request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\BadRequestHttpException: "Untrusted Host "52.47.154.91"
It's strange because I it is not the IP of my server...
question :
How would you investigate this?
=> I think that I need more details in the log, but I don't know how to make monolog be more verbose on this error only
complementary information :
I'm hosted on AWS I know thaht need some special tuning, but I think that my app.php is well configured for running behind an ELB:
Request::setTrustedProxies(
// trust *all* requests
array('127.0.0.1', $request->server->get('REMOTE_ADDR')),
Request::HEADER_X_FORWARDED_AWS_ELB
);
and The IP that is loggued is the IP of the ELB (load balancer)
You probably have something like this in the config
trusted_hosts:
- "%domain%"
either remove it or add the IP

Symfony 2.8.4 + BeSimpleSsoBundle + Jasig CAS Error

I have a problem with my application.
I use Symfony 2.8.4 and in vendors list I ave besimmple/sso-auth-bundle, in last version.
I have an application on an old centos server with php 5.3.3 which work, but with symfony 2.5, I have to upgrade symfony.
On dev plateform ( winw 10 + wamp 2.4) my application work : besimple can authanticate on my CAS server, no pb. But on my new server, centos 7, php 5.4.16 it doesn't work I got this exception :
Cannot communicate securely with peer: no common encryption algorithm(s).
500 Internal Server Error - RequestException
Stack Trace
in vendor/kriswallsmith/buzz/lib/Buzz/Client/Curl.php at line 31 -
$errorMsg = curl_error($this->lastCurl);
$errorNo = curl_errno($this->lastCurl);
$e = new RequestException($errorMsg, $errorNo);
$e->setRequest($request);
throw $e;
I have an another application, GLPI on this server which use curl to, and it works.
I don't know what to do and I my application he's up to be in production.
I tried to change curl_opt in with CIPHER_LIST like that :
curl_setopt($this->lastCurl , CURLOPT_SSL_CIPHER_LIST, 'ecdhe_rsa_aes_128_gcm_sha_256');
but I've got this error :
Cannot connect: SSL is disabled.
500 Internal Server Error - RequestException
Stack Trace
in vendor/kriswallsmith/buzz/lib/Buzz/Client/Curl.php at line 31 -
$errorMsg = curl_error($this->lastCurl);
$errorNo = curl_errno($this->lastCurl);
$e = new RequestException($errorMsg, $errorNo);
$e->setRequest($request);
throw $e;
Can you help me ?
PS : i'm trying to put the application on an other server, with debien to see if the problem comes with my distribution.
I answer myself.
I was requesting the CAS server through an old pfsense reverse proxy. I updated the pfsesnse to the last version (2.3.2) and all it's ok now.
Don't forget tu use this config for BeSimpleSso :
be_simple.sso_auth.client.option.curlopt_ssl_version.value: 1
be_simple.sso_auth.client.option.curlopt_ssl_verifypeer.value: false

Resources