Seemingly missing file when using JanRain OpenID PHP library with MySQL - php

I've just set up the JanRain OpenID library for PHP (https://github.com/openid/php-openid). I'm attempting to use the example server file, and the error I get is:
Warning: require_once(DB.php): failed to open stream: No such file or directory in /path/to/file/examples/server/config.php on line 28
I have searched the package and have not found any such file (DB.php). I do not see mention of it being generated. The config file I'm using was generated by the JanRain library's setup.php script.
Can anyone point me in the direction of what this file (which the library seems to expect) is and how I can obtain it?

DB.php is a part of pear DB package,
#pear install DB
for centos 6.x
#pear install DB-1.8.2
Thank for http://nobuneko.com/blog/archives/2016/01/php_533_pear_install_db_failed_php_540_higher.html

Related

Error and warning connecting MongoDB to PHP using php_mongodb extension

I installed the MongoDB PHP driver on Windows 10 (I'm using WAMP equipped with PHP 5.6.25. following the istructions I found at http://php.net/manual/en/mongodb.installation.windows.php and I installed also the libbson and libmongoc libraries (requested as requirements) as written at http://php.net/manual/en/mongodb.requirements.php.
Then, I added the bin folders of MongoDB, libbson and libmongoc to system path.
However, even if I can see the php_mongodb extension in the extensions list of WAMP, launching phpinfo() the mongo extension doesn't appear with the others.
Furthermore, tryng to connect to my database with
<?php
$mongo=new MongoClient("");
$db=$mongo->galileo;
$collection= $db->items;
print_r("Number of documens: "); ?>
I got the error
Fatal error: Class 'MongoClient' not found in C:\wamp64\www\galileo\index.php >on line 21
At a first look, reading this error, it might seem like that PHP is looking for php_mongodb extension in the uncorrect folder i.e. C:\wamp64\www\galileo\index.php (where the index page of my project is placed) instead of the correct one C:\wamp64\bin\php\php5.6.25\ext where all the extensions are.
But, looking at php log file php_error.log I find also a warning that says:
PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp64/bin/php/php5.6.25/ext/php_mongodb.dll' - Il sistema operativo non pu� eseguire %1.
in Unknown on line 0.
(for not Italian speaking, the phrase after - means the operating system can't execute %1, even if I can't imagine what %1 stands for).
Even using the new class MongoDB\Driver\Manager I get the error
Fatal error: Class 'MongoDB\Driver\Manager' not found in C:\wamp64\www\galileo\index.php on line 21
and the same warning.
Do you notice some error or forgetfulness in the installation process as I described and, if not, do you know how to fix the problem?
The problem is certainly related to WAMP and I think is related to the multiple php.ini in his folders. In fact, in the apache folder you can find a php.ini file that cannot be modified, otherwise nothing works at all; at the same time any changes made to the php.ini file in the php folder seems have no effect except making appear the mongodb extension in the extensions list.
So, I try using XAMPP, as suggested in this video tutorial and it works. Using Composer I was able to install also the PHP library and not only the driver.
you should not use 'MongoClient class' anymore, this extension that defines this class is deprecated. look at here.
instead, you should use MongoDB\Driver\Manager class. please read http://php.net/manual/en/class.mongodb-driver-manager.php.
and the setup must be like this in php:
$mongo = new MongoDB\Driver\Manager("mongodb://localhost:27017");
And if you still use the old class; you either need to install the old legacy extension (pecl install mongo) and use PHP 5.x, or update your code to use this new driver's classes as the old driver is not available for PHP 7. There is an upgrade guide at here.
the last part is from derickr's answer in this issue on github: https://github.com/mongodb/mongo-php-driver/issues/300

Failed opening required database.inc (attempting to use drupal)

I am trying to setup a drupal web server with FreeBSD.
When I try to access the drupal index i am greeted with:
Fatal error: require_once(): Failed opening required
'/usr/local/www/apache24/data/drupal/includes/database/sqlite/database.inc'
(include_path='.:/usr/local/share/pear') in
/usr/local/www/apache24/data/drupal/includes/database/database.inc on
line 1685
I am new to freeBSD but i tried setting chmod 667 to the:
sqlite/database.inc
database/database.inc
sqlite
database
Also, i do not understand why it is looking for /usr/local/share/pearas there is no such directory.
I am using MySQL55, PHP5, Drupal-7, and Apache.
I think this might be related but when i access the install.php i get:
Undefined index: distribution_name in drupal_install_profile_distribution_name() (line 201 of /usr/local/www/apache24/data/drupal/includes/install.inc).
did you use drush?
That looks as if you already installed drupal, or at least drupal thinks so. and also with the wrong database settings. normally, you will be prompted to enter them in the web interface, but you also can enter them directly in the settings php. Propably you should just move the old settings.php and run install.php in your browser and enter the database details anew.
drupal_install_profile_distribution_name can be changed in the database under system->standard_profile and variable->install_profiles directly or using drush (www.drush.ws) with
vset install_profile standard
or any other install profile you used.
Anyways, the install script asks for that as well.
hope, this was your problem.

Why can't PHP find a libpng15.so.15?

I'm running ArchLinux 64bit, I'm trying to create a Clickstack to run Symfony on Cloudbees.
I've created a Clickstack that extends PHP-ClickStack
When trying to test the bundled PHP I get the following error:
php: error while loading shared libraries: libpng15.so.15: cannot open shared object file: No such file or directory
I've downloaded and installed LibPng15 to /usr/local/.
I've also copied that file to: /path/to/php/lib/, /path/to/php/include/, and /path/to/php/bin/. It hasn't fixed the error.
I've also downloaded tried downloading the source for PHP-5.4.24 and 5.5.8 but, when I compile them they both some of the Intl tests.
So how can I get a working binary version of PHP that I can upload to Cloudbees?
The solution was to create LD_LIBRARY_PATH as an environment variable in script.
Apparently it didn't exist.
LD_LIBRARY_PATH=/usr/lib:/usr/local/lib/:/path/to/libpng/
NOTE: adding the normal directories prevents other tools/apps from breaking.

cakePHP bake fails on opening .core.php file

im trying to bake a test project to evaluate cakePHP 2.4.1, and when i do cake bake, before the DB configuration i get the following warnings\errors:
Warning Error: file_get_content(/core.pp): failed to open stream: No such file or directory in [C:\cakePHP\lib\cake\Utility\File.php, line 157]
and after that, a whole bunch of errors (unable to set seed, unable to set cache prefix , unable to set CAKE_CORE_INCLUDE_PATH etc.)
Any help will be appreciated,
Boris.
I also setup recently cakePHP 2.4.1 and there is no error as such you described. Also there is no file like core.pp, it is core.php.
You can download it again from https://github.com/cakephp/cakephp/zipball/2.4.1 and set it up again.
Found the problem:
i set the skel path to the cakePHP base folder, and not to cakePHP\app.

How can I use the newly revamped Dropbox-PHP API?

I would like to use the Dropbox-PHP API that has recently come under development again. It is located here: http://code.google.com/p/dropbox-php/
I did cloned it with hg clone https://dropbox-php.googlecode.com/hg/ dropbox-php and I get this file structure:
Dropbox/API.php
Dropbox/autoload.php
Dropbox/Exception/Forbidden.php
Dropbox/Exception/NotFound.php
Dropbox/Exception/OverQuota.php
Dropbox/Exception/RequestToken.php
Dropbox/Exception.php
Dropbox/OAuth/PEAR.php
Dropbox/OAuth/PHP.php
Dropbox/OAuth/Zend.php
Dropbox/OAuth.php
examples/accountinfo.php
examples/createaccount.php
examples/download_image.php
examples/getmetadata.php
examples/oauth_workflow.php
examples/uploading.php
But I get this error when trying to run accountinfo.php (or example):
Warning: include(Dropbox/autoload.php) [function.include]: failed to open stream
No such file or directory in dropbox-api/examples/accountinfo.php on line 7
Right, so then I move the Dropbox folder inside of where all the example files are and still get an error message:
Fatal error: Uncaught exception 'Dropbox_Exception' with message 'The OAuth class
could not be found! Did you install and enable the oauth extension?' in
examples/Dropbox/OAuth/PHP.php:36 Stack trace: #0 examples/accountinfo.php(9):
Dropbox_OAuth_PHP->__construct('', '') #1 {main} thrown in
examples/Dropbox/OAuth/PHP.php on line 36
So I'm obviously not doing something right but I have no idea what.
Also saw on the site where it has instructions on installing:
pear channel-discover pear.dropbox-php.com
pear install dropbox-php/Dropbox-alpha
I ran those two commands and it still won't work. I don't usually have any problems coding in PHP but the lack of documentation is a little frustrating.
Update
As noted in the accepted answer below my main problem was not having oAuth installed on the system. I'm running OS X 10.6 - if someone can provide some clear and easy instructions on how to build / install this to work with XAMPP / PHP 5.3 I will accept your answer. I've tried the articles online about using homebrew and such but these are flaky and do not seem to work for me. Guessing I will have to build / install it from scratch.
The Dropbox folder needs to be inside one of the folders in your include_path.
Edit:
Also oauth needs to be "installed" on the system and included in php.ini (when you do phpinfo() oAuth should show up as a module). then things should work.

Categories