Trying to install Predis using PEAR on windows - php

Firstly I'm new to PEAR and Predis...I want to install Predis on windows 7, and theres what I have done so far...
I have installed Redis on my computer in C:/Redis.
PEAR is in \wamp\bin\php\php5.3.10 and it was installed successfully.
Now m trying to install Predis using
pear install nrk/Predis-1.0.0
It gives me the following errors
downloading Predis-1.0.0.tar ...
Starting to download Predis-1.0.0.tar (2,014,208 bytes)
...............................done: 2,014,208 bytes
Warning: require_once(Structures/Graph.php): failed to open stream: No such file
or directory in PEAR\Downloader.php on line 1192
PHP Warning: require_once(Structures/Graph.php): failed to open stream: No such
file or directory in C:\wamp\bin\php\php5.3.10\pear\PEAR\Downloader.php on line
1192
PHP Stack trace:
PHP 1. {main}() C:\wamp\bin\php\php5.3.10\pear\pearcmd.php:0
PHP 2. PEAR_Command_Common->run() C:\wamp\bin\php\php5.3.10\pear\pearcmd.php:3
07
PHP 3. PEAR_Command_Install->doInstall() C:\wamp\bin\php\php5.3.10\pear\PEAR\C
ommand\Common.php:271
PHP 4. PEAR_Downloader->sortPackagesForInstall() C:\wamp\bin\php\php5.3.10\pea
r\PEAR\Command\Install.php:699
Warning: require_once(Structures/Graph.php): failed to open stream: No such file
or directory in C:\wamp\bin\php\php5.3.10\pear\PEAR\Downloader.php on line 1192
Call Stack:
0.0010 881520 1. {main}() C:\wamp\bin\php\php5.3.10\pear\pearcmd.php:0
0.0597 4753144 2. PEAR_Command_Common->run() C:\wamp\bin\php\php5.3.10\
pear\pearcmd.php:307
0.0597 4753144 3. PEAR_Command_Install->doInstall() C:\wamp\bin\php\php
5.3.10\pear\PEAR\Command\Common.php:271
11.4545 13810008 4. PEAR_Downloader->sortPackagesForInstall() C:\wamp\bin
\php\php5.3.10\pear\PEAR\Command\Install.php:699
PHP Fatal error: require_once(): Failed opening required 'Structures/Graph.php'
(include_path='C:\wamp\bin\php\php5.3.10\pear') in C:\wamp\bin\php\php5.3.10\pe
ar\PEAR\Downloader.php on line 1192
PHP Stack trace:
PHP 1. {main}() C:\wamp\bin\php\php5.3.10\pear\pearcmd.php:0
PHP 2. PEAR_Command_Common->run() C:\wamp\bin\php\php5.3.10\pear\pearcmd.php:3
07
PHP 3. PEAR_Command_Install->doInstall() C:\wamp\bin\php\php5.3.10\pear\PEAR\C
ommand\Common.php:271
PHP 4. PEAR_Downloader->sortPackagesForInstall() C:\wamp\bin\php\php5.3.10\pea
r\PEAR\Command\Install.php:699
Fatal error: require_once(): Failed opening required 'Structures/Graph.php' (inc
lude_path='C:\wamp\bin\php\php5.3.10\pear') in C:\wamp\bin\php\php5.3.10\pear\PE
AR\Downloader.php on line 1192
Call Stack:
0.0010 881520 1. {main}() C:\wamp\bin\php\php5.3.10\pear\pearcmd.php:0
0.0597 4753144 2. PEAR_Command_Common->run() C:\wamp\bin\php\php5.3.10\
pear\pearcmd.php:307
0.0597 4753144 3. PEAR_Command_Install->doInstall() C:\wamp\bin\php\php
5.3.10\pear\PEAR\Command\Common.php:271
11.4545 13810008 4. PEAR_Downloader->sortPackagesForInstall() C:\wamp\bin
\php\php5.3.10\pear\PEAR\Command\Install.php:699

ok.. after alot of searching... I installed Predis using Composer on Windows 7.
The following is w.r.t Wamp server.
First of all, enable php_openssl in php.ini
The steps I followed were,
Install Redis from [here]https://github.com/rgl/redis/downloads to folder say, C:/Redis
Install Composer from [here]https://getcomposer.org/download/ in the root of your website.
Download Composer.phar in the root of your website.. sorry.. I didn't bookmark that link.. so I dont have it.. :(
Write this file composer.json
{"require": {
"predis/predis": "1.1.*#dev"
}}
and run this command
php composer.phar install
from the folder you have put these files (composer.phar and composer.json)..
After that, in both php.ini (apache and php) write this include_path :
include_path='.;C:\wamp\www\vendor\predis'
Now write this code to test predis
<?php
require("predis/autoload.php");
Predis\Autoloader::register();
try {
$redis = new Predis\Client(array(
"scheme" => "tcp",
"host" => "127.0.0.1",
"port" => 6379));
echo "Successfully connected to Redis";
echo $redis->ping();
}
catch (Exception $e) {
echo "Couldn't connected to Redis";
echo $e->getMessage();
}
Wish you luck! :)

Related

symfony Fatal error: require_once() bin/./SymfonyRequirements.php

I have installed Symfony 3.3.2 on a server in production. I can run command from console
$ ./bin/console --version
Symfony 3.3.2 (kernel: app, env: dev, debug: true)
When I want to check the config on my server with the url, http://example.com/config.php, I have a 500 error "HTTP ERROR 500"
When I try to run the command for symfony_requirements, I have fatal error :
$ php ./bin/symfony_requirements
PHP Warning: require_once(/var/www/symfony/bin/./SymfonyRequirements.php): failed to open stream: No such file or directory in /var/www/symfony/bin/symfony_requirements on line 4
PHP Stack trace:
PHP 1. {main}() /var/www/symfony/bin/symfony_requirements:0
PHP Fatal error: require_once(): Failed opening required '/var/www/symfony/bin/./SymfonyRequirements.php' (include_path='.:/usr/share/php') in /var/www/symfony/bin/symfony_requirements on line 4
PHP Stack trace:
PHP 1. {main}() /var/www/symfony/bin/symfony_requirements:0
How can I check the configuration of my server ?
This is an issue on github https://github.com/sensiolabs/SensioDistributionBundle/issues/324
If you can not upgrade your version of symfony, I suggest you to edit the file web/config.php, and replace
require_once dirname(__FILE__).'/./SymfonyRequirements.php';
by
require_once dirname(__FILE__).'/../var/SymfonyRequirements.php';
Edit bin/symfony_requirements and do exactly the same replacement.
If you can upgrade your version to 3.3.9, I should not have this issue

How do I add a new APP_KEY to a Laravel project?

I recently was reading this Stack Overflow post
When to generating a New Application Key in Laravel?
where colleagues mentioned that you can run:
php artisan key:generate
and this will generate a new APP_KEY for your cloned Laravel project. This being a legitimate concern when collaborating and using Github for version control, however, when I tried to run that command I got this error:
ldco2016#DCortes-MacBook-Pro-3 ~/Projects/photogallery (master)$ php artisan key:generate [ruby-2.2.1]
PHP Warning: require(/Users/ldco2016/Projects/photogallery/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /Users/ldco2016/Projects/photogallery/bootstrap/autoload.php on line 17
PHP Stack trace:
PHP 1. {main}() /Users/ldco2016/Projects/photogallery/artisan:0
PHP 2. require() /Users/ldco2016/Projects/photogallery/artisan:16
Warning: require(/Users/ldco2016/Projects/photogallery/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /Users/ldco2016/Projects/photogallery/bootstrap/autoload.php on line 17
Call Stack:
0.0002 240112 1. {main}() /Users/ldco2016/Projects/photogallery/artisan:0
0.0003 242776 2. require('/Users/ldco2016/Projects/photogallery/bootstrap/autoload.php') /Users/ldco2016/Projects/photogallery/artisan:16
PHP Fatal error: require(): Failed opening required '/Users/ldco2016/Projects/photogallery/bootstrap/../vendor/autoload.php' (include_path='.:') in /Users/ldco2016/Projects/photogallery/bootstrap/autoload.php on line 17
PHP Stack trace:
PHP 1. {main}() /Users/ldco2016/Projects/photogallery/artisan:0
PHP 2. require() /Users/ldco2016/Projects/photogallery/artisan:16
Fatal error: require(): Failed opening required '/Users/ldco2016/Projects/photogallery/bootstrap/../vendor/autoload.php' (include_path='.:') in /Users/ldco2016/Projects/photogallery/bootstrap/autoload.php on line 17
Call Stack:
0.0002 240112 1. {main}() /Users/ldco2016/Projects/photogallery/artisan:0
0.0003 242776 2. require('/Users/ldco2016/Projects/photogallery/bootstrap/autoload.php') /Users/ldco2016/Projects/photogallery/artisan:16
So its not so straightforward and error free. Can anyone lend a hand as to how to generate a new APP_KEY when working on a cloned Laravel project?
You must first install composer and run composer install so that laravel can access the commands.

Symfony php app/console server:run

I am trying to run the server but keep getting these messages when running php app/console server:run:
PHP Warning: require(/var/www/html/symfony_demo/app/../vendor/autoload.php): failed to open stream: No such file or directory in /var/www/html/symfony_demo/app/autoload.php on line 11
PHP Stack trace:
PHP 1. {main}() /var/www/html/symfony_demo/app/console:0
PHP 2. require() /var/www/html/symfony_demo/app/console:17
PHP Fatal error: require(): Failed opening required '/var/www/html/symfony_demo/app/../vendor/autoload.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/html/symfony_demo/app/autoload.php on line 11
PHP Stack trace:
PHP 1. {main}() /var/www/html/symfony_demo/app/console:0
PHP 2. require() /var/www/html/symfony_demo/app/console:17
If I run php bin/console server:run I get this message:
Could not open input file: bin/console
The only change I have made recently was use winSCP to copy my files from the remote server to my local PC. Can someone help me with the errors?
EDIT: Like an idiot I copied over the wrong project.
EDIT: Still didn't fix my issue.
You most likely didn't run composer install or forgot to copy the vendor directory.

ApiGen on windows.Can't able to run apigen command

Can anybody tell how to get working APIGen on windows. I have installed ApiGen using PEAR and the file of ApiGen resides in
C:\wamp\bin\php\php5.3.13
there are two types of file here one with batch extension and other with file extension both having name apigen.
I am getting below error while using apigen command.
Warning: require(Texy.php): failed to open stream: No such file or directory in C:\wamp\bin\php\php5.3.13\apigen on line 48
Call Stack:
0.0015 792712 1. {main}() C:\wamp\bin\php\php5.3.13\apigen:0
0.0141 1646736 2. class_exists() C:\wamp\bin\php\php5.3.13\apigen:64
0.0142 1647048 3. ApiGen\{closure}() C:\wamp\bin\php\php5.3.13\apigen:0
Fatal error: require(): Failed opening required 'Texy.php' (include_path='.;C:\wamp\bin\php\php5.3.13\pear') in C:\wamp\bin\php\php5.3.13\apigen on line 48
Call Stack:
0.0015 792712 1. {main}() C:\wamp\bin\php\php5.3.13\apigen:0
0.0141 1646736 2. class_exists() C:\wamp\bin\php\php5.3.13\apigen:64
0.0142 1647048 3. ApiGen\{closure}() C:\wamp\bin\php\php5.3.13\apigen:0
PHP Warning: require(Texy.php): failed to open stream: No such file or directory in C:\wamp\bin\php\php5.3.13\apigen on line 48
PHP Stack trace:
PHP 1. {main}() C:\wamp\bin\php\php5.3.13\apigen:0
PHP 2. class_exists() C:\wamp\bin\php\php5.3.13\apigen:64
PHP 3. ApiGen\{closure}() C:\wamp\bin\php\php5.3.13\apigen:0
PHP Fatal error: require(): Failed opening required 'Texy.php' (include_path='.;C:\wamp\bin\php\php5.3.13\pear') in C:\wamp\bin\php\php5.3.13\apigen on line 48
PHP Stack trace:
PHP 1. {main}() C:\wamp\bin\php\php5.3.13\apigen:0
PHP 2. class_exists() C:\wamp\bin\php\php5.3.13\apigen:64
PHP 3. ApiGen\{closure}() C:\wamp\bin\php\php5.3.13\apigen:0
Please follow these step (refer from this page https://github.com/ApiGen/ApiGen/wiki/installation-on-windows)
Install apigen.phar in directory you want. For example: C:\PHPCLI
Add C:\PHPCLI to Windows Path
In case that you or anyone don't know how to add Path in Windows. Right click on My Computer icon on desktop or start menu and click on Properties.
On left side of Windows properties page, click on Advanced system settings.
Click Environment Variables...
You can add C:\PHPCLI to Path in user variables or system variables. Choose one.
Click OK to all.
Open command line and enter cd C:\PHPCLI
Enter in command line again: echo #php "%~dp0apigen.phar" %*>apigen.bat
Close command line and open new command line. Test by enter this command apigen --help
It should display ApiGen help message.

I can't get PHPUnit to run - Failed opening required 'SebastianBergmann/Diff/autoload.php'

I installed PHPUnit via pear and I brought uploaded the required PHP files into the account.
I setup php.ini with every possible include path I could imagine...I know it is using the proper php.ini file because when I update it ..along with the error it shows the include paths change (below).....when I do a search of the server it simply doesn't find any folder named "SebastianBergmann"...I dont know what to do...please help..
Fatal error: require_once(): Failed opening required 'SebastianBergmann/Diff/autoload.php' (include_path='.:/usr/lib/php:/usr/local/lib/php:/home/admin/inc:/home/limber/public_html/limber/plugin/PHPUnit:/usr/local/bin/phpunit') in /home/limber/public_html/limber/plugin/PHPUnit/Autoload.php on line 69
Call Stack:
0.0001 635368 1. {main}() /usr/local/bin/phpunit:0
0.0029 1109328 2. PHPUnit_TextUI_Command::main() /usr/local/bin/phpunit:46
0.0029 1110056 3. PHPUnit_TextUI_Command->run() /usr/local/lib/php/PHPUnit/TextUI/Command.php:129
0.0047 1578072 4. PHPUnit_Runner_BaseTestRunner->getTest() /usr/local/lib/php/PHPUnit/TextUI/Command.php:150
0.0047 1578072 5. PHPUnit_Runner_BaseTestRunner->loadSuiteClass() /usr/local/lib/php/PHPUnit/Runner/BaseTestRunner.php:104
0.0049 1622128 6. PHPUnit_Runner_StandardTestSuiteLoader->load() /usr/local/lib/php/PHPUnit/Runner/BaseTestRunner.php:168
0.0055 1787856 7. PHPUnit_Util_Fileloader::checkAndLoad() /usr/local/lib/php/PHPUnit/Runner/StandardTestSuiteLoader.php:77
0.0055 1788000 8. PHPUnit_Util_Fileloader::load() /usr/local/lib/php/PHPUnit/Util/Fileloader.php:76
0.0055 1800264 9. include_once('/home/limber/public_html/limber/test/public_html/limber/core/NumTest.php') /usr/local/lib/php/PHPUnit/Util/Fileloader.php:92
0.0058 1870848 10. include_once('/home/limber/public_html/limber/plugin/PHPUnit/Autoload.php') /home/limber/public_html/limber/test/public_html/limber/core/NumTest.php:3
root#host [/home/limber/public_html/limber/test/public_html/limber/core]# `pear config-get php_bin` -i | grep -E Configurati
on\ File\|include_path
Failed loading xdebug.so: xdebug.so: cannot open shared object file: No such file or directory
Failed loading xdebug.so: xdebug.so: cannot open shared object file: No such file or directory
Configuration File (php.ini) Path => /usr/local/lib
Loaded Configuration File => /usr/local/lib/php.ini
include_path => .:/usr/lib/php:/usr/local/lib/php:/home/admin/inc:/home/limber/public_html/limber/plugin/PHPUnit => .:/usr/lib/php:/usr/local/lib/php:/home/admin/inc:/home/limber/public_html/limber/plugin/PHPUnit
Turns out I installed phpunit via pear which gave me 3.7.*, when I download and uploaded the php code from git I downloaded 3.8...when I downloaded the 3.7 PHP code it all worked properly.

Categories