apache cannot stop and always down in uniserver - php

I'm working with system that uses Apache uniserver and code framework is PHP Codeigniter. Somehow it is always down and gives the error below in log. Can anyone guide me on how to fix this?
PHP Fatal error: session_set_save_handler(): Session handler's function table is corrupt in
C:\UniServerZ\ssl\portal\system\libraries\Session\Session.php on line 11
[php7:error] [pid 5168:tid 1932] [client 175.139.156.154:52516] PHP Fatal error: Class CI_Session_database_driver contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (SessionHandlerInterface::&) in C:\UniServerZ\ssl\portal\system\libraries\Session\drivers\Session_database_driver.php on line 49,

Related

"Failed to start the session: already started by PHP" error using a CMS

I installed a CMS, named Prestashop: it runs under a specific domain, and with a specific VirtualHost configuration on Apache, on a server with other PHP applications.
When I try to login in, as administrator user, I receive the following error (this is the Apache error log):
[Wed Jan 18 00:09:16.059190 2017] [:error] [pid 31253] [client xx.xx.xx.xx:63129] PHP Fatal error: Uncaught exception 'RuntimeException' with message 'Failed to start the session: already started by PHP.' in /opt/wp/apps/prestashop/app/cache/prod/classes.php:108\nStack trace:\n#0 /opt/wp/apps/prestashop/app/cache/prod/classes.php(483): Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start()\n#1 /opt/wp/apps/prestashop/vendor/symfony/symfony/src/Symfony/Component/Security/Csrf/TokenStorage/SessionTokenStorage.php(90): Symfony\Component\HttpFoundation\Session\Session->start()\n#2 /opt/wp/apps/prestashop/vendor/symfony/symfony/src/Symfony/Component/Security/Csrf/CsrfTokenManager.php(54): Symfony\Component\Security\Csrf\TokenStorage\SessionTokenStorage->hasToken('ANONYMOUS_USER')\n#3 /opt/wp/apps/prestashop/app/cache/prod/classes.php(8196): Symfony\Component\Security\Csrf\CsrfTokenManager->getToken('ANONYMOUS_USER')\n#4 /opt/wp/apps/prestashop/classes/Link.php(722): PrestaShopBundle\Service\Routing\Router->generate('admin_product_c...')\n#5 /opt/wordpre in /opt/wp/apps/prestashop/app/bootstrap.php.cache on line 3216, referer: http://www.xxxxx.xx/adminXXX/index.php?controller=AdminLogin&token=181fa270d47386a8d523bdea6213932c&redirect=AdminDashboard'
PHP session auto_start parameter is set to 0 in php.ini.
I don't understand how can I solve this problem. It can be depends on an Apache or PHP configuration?
Thanks a lot.
I Just got the same issue with my Symfony 3.2 app, i was upgrading my web server from php 5.5.12 to php 5.6.31 when it happened. After upgrading again to php 7.0.23 everything go back to normal.

Google Adwords: Configuration Not Loading Properly

I'm following this tutorial: https://developers.google.com/adwords/api/docs/guides/first-api-call#make_your_first_api_call_1
And I'm at that step I linked. When I go into terminal and run php
path/to/GetCampaigns.php it returns this error: `PHP Fatal error: Uncaught exception 'Google\AdsApi\AdWords\v201609\cm\ApiException' with message '[QuotaCheckError.INVALID_TOKEN_HEADER # ; trigger:'_dev_token_']' in /var/www/AdwordsAPI/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/Util/Reflection.php:39
I assume that it is not finding my adsapi_php.ini file that I set up through this, which was suggested in the main tutorial: https://github.com/googleads/googleads-php-lib
If I go to browser instead and try to access the page, and then return to my logs, it returns this error in logs:
[Wed Dec 28 12:25:52 2016] [error] [client 70.162.15.23] PHP Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Config file not found as specified: 'adsapi_php.ini'. Home directory could not be located so it was not searched.' in /var/www/AdwordsAPI/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/ConfigurationLoader.php:71\nStack trace:\n#0 /var/www/AdwordsAPI/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/OAuth2TokenBuilder.php(51): Google\AdsApi\Common\ConfigurationLoader->fromFile('adsapi_php.ini')\n#1 /var/www/AdwordsAPI/vendor/googleads/googleads-php-lib/examples/AdWords/v201609/BasicOperations/GetCampaigns.php(76): Google\AdsApi\Common\OAuth2TokenBuilder->fromFile()\n#2 /var/www/AdwordsAPI/vendor/googleads/googleads-php-lib/examples/AdWords/v201609/BasicOperations/GetCampaigns.php(89): Google\AdsApi\Examples\AdWords\v201609\BasicOperations\GetCampaigns::main()\n#3 {main}\n thrown in /var/www/AdwordsAPI/vendor/googleads/googleads-php-lib/src/Google/AdsApi/Common/ConfigurationLoader.php on line 71
If I'm missing anything let me know.
It seems within the week, documentation has changed, and I was following two different versions of the documentation. All I needed to do was regenerate the developer token and update my .ini file. Everything is working fine now.

Bluemix PHP app fails on LDAP connection

This is a follow up ticket to one which was closed without answer:
https://stackoverflow.com/questions/34515574/ibm-bluemix-authentication-using-tivoli-ldap
I have migrated a PHP app which requires LDAP authentication to Bluemix and I am getting the following error:
2016-01-08T10:28:53.87+0000 [App/0] OUT 10:28:53 httpd | [Fri Jan 08 10:28:53.869250 2016] [proxy_fcgi:error] [pid 44:tid 139703240013568] [client 169.53.20.45:7120] AH01071: Got error 'PHP message: PHP Fatal error: Call to undefined function ldap_connect() in /home/vcap/app/htdocs/utils/LoginLDAP.Class.php on line 21\n', referer: http://sbrooms.w3ibm.mybluemix.net/index.php
Please note that this is not the public Bluemix, but the internal IBM one (w3ibm.mybluemix.net), hence the connection to the LDAP server should be available.
Do I have to explicitly request the connection to the LDAP server, or something else is going wrong?
Thanks,
Pimmy
Looks like the LDAP-Extension for PHP is not installed on the WebServer. The PHP message: PHP Fatal error: Call to undefined function ldap_connect() suggests that.
You can check that by adding a page to your webserver with the following content:
<?php
phpinfo();
Call that website in a webbroser and check whether there is any trace of the LDAP-extension. If not, you will need to get that extension. As there are many different ways to install it (from recompiling PHP to a call to your systems package-manager) I need more information on how your system - and especially PHP - has been installed.
Hope that helps!

AWS Elastic Beanstalk - PHP script fails to execute after deploying new version

I am using AWS Elastic Beanstalk for PHP which manage 1 EC2 linux server with Apache web server.
When deploying a different version (zip file with all my php scripts) through the management console i sometimes run into a weird situation.
In some cases, even if i am deploying a version with exactly the same scripts which all worked before, some of them suddenly aren't working. When deploying another version again (still same scripts, same content), suddenly everything is working as normal.
Example of a problematic service :
<?php
// dynamically loads needed classes
function __autoload($class_name) {
include $class_name . '.php';
}
$response = new Response();
$response->data = array('platform_version' => Configuration::PLATFORM_VERSION);
die(json_encode($response));
?>
Normally, this script returns a json object. After changing nothing and deploying a version this scripts returns nothing. Is there a way to find if an error occurred?
BTW, i can see a call to the service in the application_access_log of Apache with return status 200.
EDIT:
After changing the error level on the web server i started to see interesting information in the application_error_log :
*[Mon Nov 05 17:19:44 2012] [error] [client 10.210.159.209] PHP Fatal error: require_once() [function.require-once]: Cannot redeclare class response in /var/www/html/InstallerLog.php on line 12
[Mon Nov 05 17:19:44 2012] [error] [client 10.210.159.209] PHP Stack trace:
[Mon Nov 05 17:19:44 2012] [error] [client 10.210.159.209] PHP 1. {main}() /var/www/html/InstallerLog.php:0*
Why am i getting this error?
I am using :
require_once 'Response.php';
In my script so this kind of error should not occur for my knowledge...
OK. So eventually it was pretty basic.
The error occurred because the class name i was using, "Response", was already in use in other place (not in my code, maybe in the SDK or something like that).
After changing the name to something less generic the error didn't happen again.
Just for play safe i have also added :
if(!class_exists('MyNewResponse'))
before creating the class.

Apache fatal error

Following fatal error we are getting in apache errorlog. So IO operation increased and log file size is increasing. We dont know how we can findout and fix it?. Anyone knows pls share the details for our references.
Recently Upgraded Version : PHP ver from 5.2.17 to 5.3.14 after upgradation only following error we are getting, previously we didnt get this issue.
[Wed Sep 05 06:41:20 2012] [error] [client 80.12.96.14] PHP Fatal error: Cannot redeclare DomainNameInfo() (previously declared in /home/rackapps/conflg/ltnit.lg4:261) in /home/rackapps/lgconf/ltnit.lg4 on line 515, referer: http://in.mc1935.mail.yahoo.com/mc/welcome?.gx=1&.tm=1346806375&.rand=8k3tjpq0fmk8b
Note : Actually its a included files. We cant able to findout the landing php file. Because in that file we have included the above file. how we can findout the landingfile.
PHP Fatal error: Cannot redeclare DomainNameInfo()
This is an php error and not apache. You definied a function DomainNameInfo() on lltnit.lg4 on line 261 and on lgconf/ltnit.lg4 line 515 you defined the same function again .... there's your fault ....
hint: when you use inlcude() / require you can alternativ use the function include_once() / require_once() to avoid the error by including functions twice ...

Categories