I was trying to install new packages in my PHP environment development via PEAR but as shown below:
File http://pear.php.net:80/rest/p/packages.xml not valid (received: HTTP/1.1 404 Not Found)
it seems that php.net is down.
I tried to setup a mirror since us.php.net which Digg hosts with the following command:
pear config-set preferred_mirror us.pear.php.net
which gives the following error:
Channel Mirror "us.pear.php.net" does not exist in your registry for channel "pear.php.net".
Attempt to run "pear channel-update pear.php.net" if you believe this mirror should exist as you may have outdated channel information.
Of course I can't update the channel since php.net is down.
Does anyone know how i should proceed?
As it is down, nothing you can do except for waiting it to be up again.
Let's wait together, I cannot do several tasks due to the reason too.
Related
I have been trying to get laravel installed with no success.
I have been following what seems to be the usual recipe
git clone -b develop git://github.com/laravel/laravel.git myapp
cd myapp
curl -sS https://getcomposer.org/installer | php
php composer.phar install
When I run it I always get the following. I tried killing the cache dir updating etc.
Running PHP Version 5.4.6 open-ssl , mcrypt enabled in the cli.
Just don't know what I'm missing. Been giving it a shot for over a week. Saw some talk about network issues. When I manually download the json in the browser, I notice it redirects to a secure https url. Any pointers would be great. I've have never had a problem like this where I have not been able to dig up the answer.
# php composer.phar install
Loading composer repositories with package information
Installing dependencies
[Composer\Downloader\TransportException]
The "http://packagist.org/p/laravel/framework$de13d7a9bde179aa3dbe63308a250
911fa2330b3e0ba7510dea52827ec3c2f14.json" file could not be downloaded: fai
led to open stream: HTTP request failed!
I noticed with wget or a browser, I would get an https redirect. It seems that however composer does it is different enough from these other 2 that it creates a firewall problem. The link above solved it by adding a section to my composer.json file. Now it doesn't need to redirect as it is starting at https. I am running behind a sonicwall. I am not sure why it would work with a browser and wget, but not composer. It solved it however.
You're cloning the Developer branch from github. This version can be broken in the moment. So you could wait and try it later again (maybe it'll get fixed meanwhile) or you download this develop.zip which is the official way described in the L4 documentation.
I've just installed PEAR into WAMP attempting to follow this article. It all seems to have gone okay but when I type "pear upgrade" into the command prompt I get this error:
ERROR: failed to mkdir c:\php\pear\docs\Archive_Tar\docs
It is looking on the wrong drive (and missing a subdirectory in that path by the looks of it). It should be looking for D:\php\php5.3.13\pear\docs\Archive_Tar\docs
When specifying installation directories I chose ones on the D:\ and thats where the folder structure is, the include_path in both php.ini locations have also been updated. I've also reset the WAMP server after making the changes.
How do I set it to look / install the package in the right place?
My advice is to remove your complete PEAR installation and install from scratch. It'll save you time and sweat. If you have the time and patience, you can fix PEAR parameters with the config-* subcommands:
C:\>pear
Commands:
[...]
config-create Create a Default configuration file
config-get Show One Setting
config-help Show Information About Setting
config-set Change Setting
config-show Show All Settings
Start with pear config-show to inspect current values and see if you can spot invalid ones.
Can you walk me through the installation of a library for php, specifically what each terminal command does?
I have been learning web development for 6 months and it is time I need the console / terminal. I can't find any beginner walkthrough of using the terminal to add libraries and plugins to PHP. There are a lot of tutorials for specific steps or errors, but none start to finish.
If you want specifics to make your example concrete, here is what I am trying to install:
The library I am installing: http://code.google.com/p/phpquery/.
My directory for PHP on MAMP: /Applications/MAMP/bin/php/php5.3.6/bin
Thanks!
Don
edit:
I figured out my specific issue, but I don't think I really understand what I did, so I can't repeat it by myself in any other situation. This thread can help a lot of new terminal users including myself. The type of response I am looking for would go like this:
Step 1: Open your terminal. (This is an alternative way to navigate and execute commands on files on your computer).
Step 2: Find out where MAMP is installed however you like. Then go to your terminal, and type in cd followed by the path. cd stands for current directory and tells your terminal where it should execute its commands. The command you use will be very similar to this cd /Applications/MAMP. This will make your current directory MAMP.
Step 3: You are adding a library to PHP. So you need to go to the PHP folder in MAMP.... (please help us from this part!)
I just checked and it is available in pear channels.
# this is from their site
pear channel-discover phpquery-pear.appspot.com
pear install phpquery/phpQuery
Of course, for Mac using MAMP, you would use commands like this:
/Applications/MAMP/bin/php5/bin/pear install [package]
So for PHPQuery, try this:
/Applications/MAMP/bin/php5/bin/pear channel-discover phpquery-pear.appspot.com
/Applications/MAMP/bin/php5/bin/pear install phpquery/phpQuery
Same method should apply to pecl extensions as well.
EDIT
I personally just installed it on mine to test, here were my results:
$ /Applications/MAMP/bin/php5/bin/pear channel-discover phpquery-pear.appspot.com
Adding Channel "phpquery-pear.appspot.com" succeeded
Discovery of channel "phpquery-pear.appspot.com" succeeded
$ /Applications/MAMP/bin/php5/bin/pear install phpquery/phpQuery
downloading phpQuery-0.9.5.386-pear.tgz ...
Starting to download phpQuery-0.9.5.386-pear.tgz (100,990 bytes)
......................done: 100,990 bytes
install ok: channel://phpquery-pear.appspot.com/phpQuery-0.9.5.386
This should work with any PEAR or PECL extension. Check out this page for a list of PEAR packages.
EDIT 2
Make sure /Applications/MAMP/bin/php5/lib/php is in your include path! That is where phpQuery.php will be located once you've downloaded the PEAR packages properly with MAMP.
EDIT 3
Per cshu's comment, he mentioned that these packages are no longer maintained and that you should use this instead:
$ /Applications/MAMP/bin/php5/bin/pear channel-discover pear.querypath.org
$ /Applications/MAMP/bin/php5/bin/pear install querypath/QueryPath
I was trying to install XML_Query2XML package but I am getting below error (I tried to install without -o parameter too, but got same error)
C:\Users\devdiu>pear install -o XML_Query2XML
No releases available for package pear.php.net/XML_Query2XML
install failed
Then I tried to install with specific version (which is latest as on today)
C:\Users\devdiu>pear install -o XML_Query2XML-1.7.2
No releases available for package "pear.php.net/XML_Query2XML"
install failed
Does any one know the issue?
I already tried that too. I have no clue why its giving error. I have installed it 3 times before I started getting this error. I actually wanted to ask different question but I stuck up at this one now.
Alternate way
I am manually copying the files into PEAR folder, to avoid further wastage of time
SOLUTION:
I got the solution in the link Lukas reconmended and resolved using this command (there are multiple accepted solutions there)
shell>pear clear-cache
I have a VPS running a VPS optimized Debian distro.
I am very new to utilizing a VPS and have next to zero Linux background.
A little background to help:
I went through and apt-get install pear which went through fine.
I attempted to install the dependent services for the Digg api as such:
pear install HTTP_Request2
This provided an error, I had to install it with:
pear install HTTP_Request2-alpha
Then I attempted:
pear install HTTP_OAuth
This provided the same error as above, I installed it eventually with:
pear install HTTP_OAuth-alpha
So I then successfully installed Digg2 with pear install Services_Digg2
Okay, background over. My issue is that it will not initiate the class as it says the file is not there. The PHP is as simple as this:
require_once 'Services/Digg2.php';
$api = new Services_Digg2;
I checked my include path as per the error in PHP:
Fatal error: require_once() [function.require]:
Failed opening required 'Services/Digg2.php' (include_path='/usr/share/php')
in /var/www/redacted1/data/www/redacted2/index.php on line 3
So I verified that the file was there in Terminal:
http://snapplr.com/tk9r
And I verified that the include path was proper via PHP_Info():
http://snapplr.com/dwk7 (sorry I can only post one hyperlink as I'm new)
The error remains.
Hopefully my lengthy intro isn't a hassle and actually helps.
Any incite?
Thanks
Jeff
To install a PEAR/PECL package that is in a state other than "stable", you have to specify the full spec for the package:
pear install Services_Digg2-alpha #alpha state
pecl install ssh2-0.11.2 #beta state
PEAR also takes care of dependencies (usually, but I can confirm in that specific case that it does). You don't have to manually install them.
Now that you have it installed, it should work like you did:
include_once 'Services/Digg2.php'
However, I'm a little concerned that your code shows include_once while the error message you have shows you are using require_once. This leads me to believe that the code you posted is not the actual code.