Error in php code after php and mysql upgrades - mariadb

My server has been upgraded and since then one of my old application is not working
PHP
from PHP Version 5.04 to PHP Version 5.4.156.
MYSQL
MySQL database has been upgrade from MySQL version 4.1 to MariaDB Version 5.5.52(MySQL Compatiable).
Here am attaching some of the error codes and if anybody have any ideas please help to solve this issue.
Error in login
This is the error and corresponding lines of codes.
PHP Fatal error: Call to undefined function import_request_variables() in
/user/jsf/public_html/guru/post_login.php on line 3 import_request_variables ("p","p_");
PHP Notice: Undefined index: hash in /user/jsf/public_html/guru/check_login.inc
on line 7 $query.=$_REQUEST['hash']."' and login='".$_REQUEST['login']."'";
PHP Notice: Use of undefined constant is_on_server - assumed 'is_on_server' in
/user/jsf/secret/defs.inc on line 2 define (is_on_server,TRUE);
Error in Registration
PHP Notice: Use of undefined constant is_on_server - assumed 'is_on_server' in
/user/jsf/secret/defs.inc on line 2, referer: http://www.test.com/~jsf/akl/login.php define (is_on_server,TRUE);
PHP Notice: Use of undefined constant MYSQL_SERVER - assumed 'MYSQL_SERVER' in
/user/jsf/secret/defs.inc on line 13, referer: http://www.test.com/~jsf/akl/login.php define (MYSQL_SERVER,"hostname");
PHP Notice: Use of undefined constant MYSQL_NAME - assumed 'MYSQL_NAME' in
/user/jsf/secret/defs.inc on line 14, referer: http://www.test.com/~jsf/akl/login.php define (MYSQL_NAME,"dbname");
PHP Notice: Use of undefined constant MYSQL_PASSWORD - assumed 'MYSQL_PASSWORD'
in /user/jsf/secret/defs.inc on line 15, referer: http://www.test.com/~jsf/akl/login.php define (MYSQL_PASSWORD,"password");
PHP Notice: Use of undefined constant MYSQL_DB - assumed 'MYSQL_DB' in
/user/jsf/secret/defs.inc on line 16, referer: http://www.test.com/~jsf/akl/login.php define (MYSQL_DB,"db name");
PHP Notice: Undefined variable: error in /user/jsf/public_html/akl/register.php
on line 37, referer: http://www.test.com/~jsf/akl/login.php <?php if ($error)
PHP Fatal error: Call to undefined function import_request_variables() in
/user/jsf/public_html/akl/register.php on line 52, referer: http://www.test.com/~jsf/akl/login.php import_request_variables ('p','p_');

Related

getting array_filter error parameter 2 must be array. In hestia cp

I have multiple sites running on my server using hestiacp.
Today when i tried to add new website database it gives me internal server error 500.
Same is the case when i try to open configure in admin settings its also gives internal server error 500.
What's the possible solution to fix it?
2023/02/03 13:16:29 [error] 1025149#0: *24 FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught TypeError: array_map(): Argument #2 ($array) must be of type array,thrown in /usr/local/hestia/web/edit/server/index.php on line 148” while reading response header from upstream, client: 119.73.117.147, server: _, request: “GET /edit/server/ HTTTP/1.1”, upstream: “fastcgi://unix:/var/run/hestia-php.sock:”, host: “user.silverline.dev:8083”, referrer: “https://user.silverline.dev:8083/list/server/ 1”
2023/02/03 13:16:29 [error] 1025149#0: *24 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught TypeError: array_map(): Argument #2 ($array) must be of type array, null given in /usr/local/hestia/web/add/db/index.php:152
Stack trace:
#0 /usr/local/hestia/web/add/db/index.php(152): array_map()
i tried to check all codes but there is nothing wrong it was working fine a day before and today all of a sudden this happened

ConMan start error, cannot recognize options in conman.conf, how to fix?

conman version:
conman.x86_64 0.2.5-2.4.el6 #rhel-install
conman.conf
server syslog="local4"
global ipmiopts="admin,Password#_"
global log="/home/tops/%N.log"
global logopts="nosanitize,timestamp"
console name="17B001682" dev="ipmi:10.153.107.105"
running output:
[tops#HP380 ~]$ sudo /etc/init.d/conman restart
Starting ConMan: ERROR: CONFIG[/home/tops/conman.conf:2]: unrecognized token 'ipmiopts'
ERROR: CONFIG[/home/tops/conman.conf:6]: console [17B001682] device "ipmi:10.153.107.105" type unrecognized
ERROR: Configuration "/home/tops/conman.conf" has no consoles defined
[FAILED]
Why this error takes place and how can I fix it? thanks!

When i install the wordpress theme it shows me like this

What should i do to remove this bug or error ?
I have downloaded the theme but when i install it,It actually shows this
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo
failed: Temporary failure in name resolution in
/customers/3/3/f/mabox-ks.com/httpd.www/wp-content/themes/amytheme/inc/update-notifier.php
on line 115
Warning:
file_get_contents(http://themes.cray.bg/themeupdatesnotifier/amy.xml):
failed to open stream: php_network_getaddresses: getaddrinfo failed:
Temporary failure in name resolution in
/customers/3/3/f/mabox-ks.com/httpd.www/wp-content/themes/amytheme/inc/update-notifier.php
on line 115
Warning: Cannot modify header information - headers already sent by
(output started at
/customers/3/3/f/mabox-ks.com/httpd.www/wp-content/themes/amytheme/inc/update-notifier.php:115)
in /customers/3/3/f/mabox-ks.com/httpd.www/wp-admin/includes/misc.php
on line 1114
Warning: Cannot modify header information - headers already sent by
(output started at
/customers/3/3/f/mabox-ks.com/httpd.www/wp-content/themes/amytheme/inc/update-notifier.php:115)
in
/customers/3/3/f/mabox-ks.com/httpd.www/wp-content/themes/amytheme/ReduxFramework/ReduxCore/framework.php
on line 2498
Warning: Cannot modify header information - headers already sent by
(output started at
/customers/3/3/f/mabox-ks.com/httpd.www/wp-content/themes/amytheme/inc/update-notifier.php:115)
in
/customers/3/3/f/mabox-ks.com/httpd.www/wp-content/themes/amytheme/ReduxFramework/ReduxCore/framework.php
on line 2499
Warning: Cannot modify header information - headers already sent by
(output started at
/customers/3/3/f/mabox-ks.com/httpd.www/wp-content/themes/amytheme/inc/update-notifier.php:115)
in
/customers/3/3/f/mabox-ks.com/httpd.www/wp-content/themes/amytheme/ReduxFramework/ReduxCore/framework.php
on line 2504
Warning: Cannot modify header information - headers already sent by
(output started at
/customers/3/3/f/mabox-ks.com/httpd.www/wp-content/themes/amytheme/inc/update-notifier.php:115)
in /customers/3/3/f/mabox-ks.com/httpd.www/wp-includes/pluggable.php
on line 1216

Undefined variable: matches in .. /app/cache/prod/appProdUrlMatcher.php on line .. intermittent issue

The web page is on Symfony 2.5.2 with 5 selfcreated bundles and FOSUserbundle.
It is rather large, but essentially resembles a blog with user comments.
It is on a shared OVH server.
It works in dev and prod, but when in prod : after one to three days I either receive an http error 500 or (more seldom) an empty page with the URL http://mypage.com/web//
The latter indicates that the route has not been found.
Still the route MUST be there, as the problem appears "over night", i.e. intermittently.
When I have either one of these situations the following remedies "solve" the problem:
clear the cache (I normally delete the whole directory app/cache/prod)
pass the AppKernel from 'prod',false to 'prod',true (without clearing the cache
passing into app_dev.php
I do not know if the intermittence would also occur for the case 2 (as I do not want to run the risk leaving the site open that way).
For case 3: when going back to prod without having cleared the cache, the problem remains.
When I get an error 500, there is no entry in the log file.
Whenever I checked at the time I got the the empty page error (with the URL ending web// ), the log file has no entry; but there is an entry from hours before (from a visitor I suppose) indicating:
[2015-07-23 04:04:18] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /dir1/dir2/fr"" at /home/mysite/www/Symfony/app/cache/prod/classes.php line 1977 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException: No route found for \"GET /dir1/dir2/fr\" at /home/mysite/www/Symfony/app/cache/prod/classes.php:1977, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException: at /home/mysite/www/Symfony/app/cache/prod/appProdUrlMatcher.php:545)"} []
I have tried
to add in web/app.php a $response->setMaxAge(600); which exhibits also intermittent errors (removed it again)
to add an automatic cache removal in the homepage controller (to my defense: this was NOT intented as a solution, but for debugging only). It is removed again after intermittence remained still.
//---------- clears cache first user at midnight
$dirDate=date('d',filemtime($this->container->getParameter('kernel.cache_dir')));
if (date('d') != $dirDate AND date('H')<6) {
//--- from http://stackoverflow.com/questions/24115395/programmatically-clear-cache-on-symfony-2
$fs = new Filesystem();
$fs->remove($this->container->getParameter('kernel.cache_dir'));}
I tried to add $kernel = new AppCache($kernel); in web/app.php but couldn't get it to work at all (as it is outside my competency).
I cannot continue to manually clear the cache every day (or more often?) and the intermittent character of the problem does not allow for a typical trial-and-error-debugging excersize.
I need help to understand the cause prior continuing taking "blind" actions.
I can certainly share more of the coding, but wouldn't know which portion to share with the community here. There is likely no "typical" bug, as the code always works for a while and the problem ONLY pops up after 1 to 3 days, intermittently.
Add-on after Francesco's comment:
There is no error in the log file in Symfony's app/log, but I found some in the (shared) server's log (logs.ovh.net). Still, these logs are only the consequence of the 500 error. There are two distinct messages (and many of each one):
[Sat Jul 25 23:29:07 2015] [error] [client 66.249.64.104] [host www.mywebsite.com] FastCGI: comm with server "/homez.437/myweb/www/Symfony/web/app.php" aborted: idle timeout (300 sec)
[Sat Jul 25 23:29:07 2015] [error] [client 66.249.64.104] [host www. mywebsite.com] FastCGI: incomplete headers (0 bytes) received from server "/homez.437/myweb/www/Symfony/web/app.php"
[Sat Jul 25 23:29:07 2015] [error] [client 66.249.64.104] [host www. mywebsite.com] FastCGI: An error happend on Fastcgi processing, fallback to CGI
[Sat Jul 25 23:29:10 2015] [error] [client 66.249.64.104] [host www. mywebsite.com] (103)Software caused connection abort: Failed to flush CGI output to client
[Sat Jul 25 22:35:58 2015] [error] [client 66.249.64.94] [host www. mywebsite.com] (104)Connection reset by peer: FastCGI: comm with server "/homez.437/myweb/www/Symfony/web/app.php" aborted: read failed
[Sat Jul 25 22:35:58 2015] [error] [client 66.249.64.94] [host www. mywebsite.com] FastCGI: incomplete headers (0 bytes) received from server "/homez.437/myweb/www/Symfony/web/app.php"
[Sat Jul 25 22:35:58 2015] [error] [client 66.249.64.94] [host www. mywebsite .com] FastCGI: An error happend on Fastcgi processing, fallback to CGI
The errors logged on the shared server occured whilst I could access the website with no problems. What does that mean?
UPDATE OF PROBLEM STATEMENT 3 MONTHS AFTER THE FIRST REV:
I finally managed to retrieve an error code by adding the following code to app.php (top of code before the first "use"):
ini_set('display_errors', 1);
error_reporting(-1);
The error then pops up in html under the site's uri:
Notice: Undefined variable: matches in /xxx/app/cache/prod/appProdUrlMatcher.php on line 84
Warning: array_replace(): Argument #1 is not an array in /xxx/app/cache/prod/appProdUrlMatcher.php on line 84
Warning: Invalid argument supplied for foreach() in /xxx/app/cache/prod/classes.php on line 1414
Notice: Undefined index: _route in /xxx/app/cache/prod/classes.php on line 1966
Notice: Undefined variable: matches in /xxx/app/cache/prod/appProdUrlMatcher.php on line 84
Warning: array_replace(): Argument #1 is not an array in /xxx/app/cache/prod/appProdUrlMatcher.php on line 84
Warning: Invalid argument supplied for foreach() in /xxx/app/cache/prod/classes.php on line 1414
Notice: Undefined index: _route in /xxx/vendor/symfony/symfony/src/Symfony/Component/Security/Http/HttpUtils.php on line 112
Line 82 to 85 of appProdUrlMatcher.php are
// mysite_publish_artWork
if (0 === strpos($pathinfo, '/gallery/publish') && preg_match('#^/gallery/publish/(?P<idOfArtWork>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'aliquam_publish_artWork')), array ( '_controller' => 'Aliquam\\ArtWorkBundle\\Controller\\ArtWorkController::publishArtWorkAction',));
}
NB: line 84 is the line starting with return $this->
When I simply add a CRLF (Notepad++) so that the code above looks like:
// mysite_publish_artWork
if (0 === strpos($pathinfo, '/gallery/publish') && preg_match('#^/gallery/publish/(?P<idOfArtWork>[^/]++)$#s', $pathinfo, $matches)) {
return $this->mergeDefaults(array_replace($matches, array('_route' => 'mysite_publish_artWork')),
array ( '_controller' => 'MySite\\ArtWorkBundle\\Controller\\ArtWorkController::publishArtWorkAction',));
}
then the error 500 disappears and the page loads.
This appProdUrlMatcher.php is not a class I created; it is part of the symfony created cache. Surely, I can delete it and it will then work for a while until the error pops up again.
The route is a route to a (secured, only admin access) controller. whilst all these intermittent issues happened I di d not call the route once.
NB: when I call the route as administrator it does work.
Here is the yml of the route:
mysite_publish_artWork:
pattern: /publish/{idOfArtWork}
defaults: { _controller: MysiteArtWorkBundle:ArtWork:publishArtWork }
requirements:
idOfArtWork: \d+
and the corresponding controller
public function publishArtWorkAction($idOfArtWork)
{
$em=$this->getDoctrine()->getManager();
$repository=$em->getRepository('AliquamArtWorkBundle:ArtWork');
$artWork=$repository->find($idOfArtWork);
$listOfArtWork=$repository->findAll();
if (isset($idOfArtWork))
{
if ($artWork->getPublicate()==true){$published=false;}else{$published=true;}
$csrfProvider = $this->container->get('form.csrf_provider');
$unique_fake = $csrfProvider->generateCsrfToken('unique_fake');
if ($this->getRequest()->query->get('csrf_unique_fake')==$unique_fake)
{
$artWork->setPublicate($published);
$em->persist($artWork);
$em->flush();
$translatedText = $this->get('translator')->trans('message.flash.modified');
$this->get('session')->getFlashBag()->set('infoGlobal',$translatedText);
}
foreach ($listOfArtWork as $l)
{
$l->setContent(substr($l->getContent(),0,25)."...");
}
}
return $this->redirect($this->generateUrl('mysite_manage_artwork'));
}
I can delete/clear the cache, but would it make really sense to rewrite a file in cache/prod/ ? I don't think that's a good idea. But I am short of any other.
And, something which happened today: I can access the site on my PC, but not on my cell phone (Windows Phone).
Below the "repair" which succeeded to make the intermittent error disappear for one month now (before it occured every 2-4 days).
It is the line in xxx/app/cache/prod/appProdUrlMatcher.php where I added simply $ee=3 which does nothing else than just defining $ee.
NB: this php-file was generated automatically by the symfony cache system.
I have no explanation why, but the $ee=3 seems to do the trick.
// mysite_publish_artWork
if (0 === strpos($pathinfo, '/gallery/publish') && preg_match('#^/gallery/publish/(?P<idOfArtWork>[^/]++)$#s', $pathinfo, $matches)) {
$ee=3;
return $this->mergeDefaults(array_replace($matches, array('_route' => 'aliquam_publish_artWork')), array ( '_controller' => 'Aliquam\\ArtWorkBundle\\Controller\\ArtWorkController::publishArtWorkAction',));
}

Moodle 1.9.4 no public key

I can't get a public key for my Moodle network, the xlrpc is installed on Ubuntu. Can anyone help?
Moodle: 1.9.4
Apache: 2.2.8
PHP: 5.2.4-2
Error on debug mode:
Warning: openssl_csr_new() [function.openssl-csr-new]: dn: add_entry_by_NID 17 ->
Moodle (failed) in /var/www/moodle_teste/mnet/lib.php on line 361
Warning: openssl_csr_sign() [function.openssl-csr-sign]: cannot get CSR from
parameter 1 in /var/www/moodle_teste/mnet/lib.php on line 362
Warning: openssl_x509_export() [function.openssl-x509-export]: cannot get cert
from parameter 1 in /var/www/moodle_teste/mnet/lib.php on line 380
Warning: openssl_x509_free() expects parameter 1 to be resource, boolean given
in /var/www/moodle_teste/mnet/lib.php on line 381

Resources