Fatal error: Class 'PDO' not found [duplicate] - pdo

This question already has an answer here:
PDO class not found fatal error after upgrading to php 5.3.x
(1 answer)
Closed 9 years ago.
i'm very confused about this
Fatal error: Class 'PDO' not found in /home/itstec2/public_html/pard_config/class/Config.php on line 13
this is my Config.php
<?php
$dbhost=null;
$dbname=null;
$dbuser=null;
$dbpass=null;
$file = __DIR__ ."/config.json";
$array = file_get_contents($file);
$dbConfig=json_decode($array);
$pardConfig=new PDO('mysql:host='.$dbConfig[0].';'.'dbname='.$dbConfig[1],$dbConfig[2],$dbConfig[3]);
?>
Config.php file is working with all other includes.but it's not working with the domain. It has that fatal error .why is that ?
My Domain

If you compare the output of your phpinfo() function to the other directories, where it is working you'll notice that the PDO object is indeed not loaded and that it is using a different php.ini in the directory where it is not working. On the working parts PHP is using /usr/local/lib/php.ini while it is using /home/itstec2/public_html/php.ini in the directory where it isn't working.
Some providers allow you to use different PHP configurations for different parts within the web root. If you use an extra ini file for a specific directory you have to make sure that you have all necessary settings in there.

Related

Karate : File not found error for js file which is in a reusable feature folder and this feature is called from another feature [duplicate]

This question already has an answer here:
Unable to use classpath or relative path to read json payload data
(1 answer)
Closed 1 year ago.
Karate: I have a reusable feature file which uses a js file.
Folder1
-test feature ( this is calling auth.feature)
Utility folder
auth js file
auth feature
authRunner java
If I run authRunner as a Junit test it runs fine.
But if I call the auth feature file from another folder outside of Utility using read, I get an error that auth js file not found.
Look for info on the this: prefix in the docs here: https://github.com/intuit/karate#reading-files hopefully that solves your issue.
* def foo = read('this:auth.js')

How do I solve fusionauth php client error 'FusionAuthClient' not found?

when I follow https://github.com/FusionAuth/fusionauth-php-client
I can see error:
PHP Fatal error: Uncaught Error: Class 'FusionAuthClient' not found ... on line 6
My application looks like this:
First application
<?php
require_once 'FusionAuthClient.php';
$apiKey = "7W-yBfeXfniDhu8PR_h0dGkSsPDJlpUYuP9rP2xXd_4";
$client = new FusionAuthClient($apiKey, "http://localhost:9011");
line 6 is last.
composer says all is right
$ composer require fusionauth/fusionauth-client
Using version ^1.6 for fusionauth/fusionauth-client
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing fusionauth/fusionauth-client (1.6.1)
Downloading: 100%
Writing lock file
Generating autoload files
FusionAuthClient.php, ClientResponse.php and RESTClient.php are in the same directory as my test script.
Can you point me into the right direction what is cause of this problem?
Have you looked at the first line of the FusionAuthClient.php file? apparently not.
namespace FusionAuth;
Therefore, the class is not in the global namespace, therefore you need to tell php which namespace it's in:
$client = new FusionAuth\FusionAuthClient($apiKey, "http://localhost:9011");
You're welcome.
That looks the require_once function path is invalid
Do have you same bug when using "require" and not "require_once"?

PHP Fatal error: Class 'jsonserializable' not found in Unknown on line 0

Ubuntu 16.04
PHP 7.0.4
Phalcon 2.1.x
Zephir
$~: php -v
PHP Fatal error: Class 'jsonserializable' not found in Unknown on line 0
When add phalcon.so in php.ini
Somehow I found the answer on and old bug report here:
Segmentation fault after update to 2.1.x
The problem is that the phalcon extension is being loaded before the json extension, so I guess that you, as myself, added the extension=phalcon.so line in the main php.ini
What you have to do is add a file in /etc/php/7.0/mods-available called phalcon.ini with the line in it: extension=phalcon.so
Then you just go and make a softlink that points from /etc/php/7.0/cli/conf.d/50-phalcon.ini to that phalcon.ini file, (important to put a number higher than 20 so it gets loaded after the json extension) and that's it!
Repeat the process to any other configuration that you have for php (apache, nginx, etc).

How to deploy fuelphp website to server

I'm new to fuelPHP, I developed a simple application and when I uploaded the files to my web server I got those errors :
Notice: Use of undefined constant __DIR__ - assumed '__DIR__' in /home1/tdfdf/public_html/site/site/public/index.php on line 22
Fatal error: require() [function.require]: Failed opening required '/bootstrap.php' (include_path='.:/usr/lib64/php:/usr/lib/php:/usr/share/pear') in /home1/tdfdf/public_html/site/site/public/index.php on line 44
I probably miss some configurations here. I also want to remove this "/public" from the url
Can any one help ?
I found the solution. The DIR is not defined for older versions of PHP . I changed my server settings to run on PHP 5.3 and it worked like magic.
Thanks.

Why my YII need have installed Oracle's Instant Client libraries?

I am playing with Yii framework and now I am investigating Yii Shell. But if I use this command:
yiic shell
I always get this error message:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/oci8.so' - libclntsh.so.11.1: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pdo_oci.so' - libclntsh.so.11.1: cannot open shared object file: No such file or directory in Unknown on line 0
libdc1394 error: Failed to initialize libdc1394
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/oci8.so' - libclntsh.so.11.1: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/pdo_oci.so' - libclntsh.so.11.1: cannot open shared object file: No such file or directory in Unknown on line 0
Error: index.php does not exist or is not an entry script file.
It is strange for me, because I am gonna to use only mySQL drivers, so why Oracle now? Any idea?
Many thanks for your replies!
Jakub
Please install Oracle client and Open your php.ini, search for oci8.so and php_oci.so, in extensions section you should have something like extension=oci8.so and extension=pdo_oci.so, just comment it with ;. If You have extension=oci8_11g.so comment it as well"
Open your php.ini, search for oci8.so and php_oci.so, in extensions section you should have something like extension=oci8.so and extension=pdo_oci.so, just comment it with ;. If You have extension=oci8_11g.so comment this as well