Fatal error: Class 'PEAR' not found in /home/user1/public_html/go-pear.php on line 697 - email

When trying to install PEAR by running go-pear.php (from the root of a cPanel GoDaddy hosted account), I get the following error:
Starting installation ... Loading zlib: ok
Bootstrapping Installer...................
Bootstrapping PEAR5.php............(remote) ok
Bootstrapping PEAR.php............(remote) ok
Bootstrapping Archive/Tar.php............(remote) ok
Bootstrapping Console/Getopt.php............(remote) ok
Fatal error: Class 'PEAR' not found in /home/alessio1/public_html/go-pear.php on line 697
line 697 is the following: PEAR::setErrorHandling(PEAR_ERROR_DIE,
"\n%s\n");
The file go-pear.php was taken directly from http://pear.php.net/go-pear without any modification.
What am I doing wrong?

I had the same error, and managed to solve it replacing the links stored in $bootstrap_files to :
$bootstrap_files = array(
'PEAR5.php' => 'https://raw.githubusercontent.com/pear/pear-core/master/PEAR5.php',
'PEAR.php' => 'https://raw.githubusercontent.com/pear/pear-core/master/PEAR.php',
'Archive/Tar.php' => 'https://raw.githubusercontent.com/pear/Archive_Tar/master/Archive/Tar.php',
'Console/Getopt.php' => 'https://raw.githubusercontent.com/pear/Console_Getopt/master/Console/Getopt.php',
);

I also had this error and found that KevinD's fix didn't work for me, but was able to figure something out based on it. To solve the problem I replaced the line
'Console/Getopt.php' => 'https://raw.github.com/pear/Console_Getopt/trunk/Console/Getopt.php',
with
'Console/Getopt.php' => 'https://raw.githubusercontent.com/pear/Console_Getopt/trunk/Console/Getopt.php',
The install completed nearly instantly for me after this change.

Use the .phar file: http://pear.php.net/go-pear.phar
It should work better.

Pay attenction: Sometimes the problem is caused because of the blocking of fsocket() php function.
Server-to-server communication is sometimes used to commit abuses for example internet attacks.
Many free hosting companies block fsocket() function by default, and sometimes you have to authenticate yourself (providing information about you) to use this function.

Related

Why I get 500 Error while on XAMPP while loading CodeIgniter 3 database library?

I have gone through number of threads on stackoverflow and on other forums to find the answer but could not find relevant answer. People have applied different approaches but none has worked for me thus far.
I am using CI 3 on XAMPP and whenever I load database library in the model, I run into 500 Error.
Here is my CI database config info:
'hostname' => 'localhost',
'username' => 'my_user',
'password' => 'my_pass',
'database' => 'prod_db',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
PHP ini db libraries are as below:
extension=php_bz2.dll
extension=php_curl.dll
extension=php_fileinfo.dll
;extension=php_ftp.dll
extension=php_gd2.dll
extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_exif.dll ; Must be after mbstring as it depends on it
extension=php_mysqli.dll
;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client
;extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll
; The MIBS data available in the PHP distribution must be installed.
; See http://www.php.net/manual/en/snmp.installation.php
;extension=php_snmp.dll
My model code is as below:
class loginmodel extends CI_Model {
public function validate_login($username, $password) {
$this->load->database();
$var = 0;
return $var;
}
}
Whenever I remove $this->load->database(); from the model, my code runs and i am able to redirect to a "Login Failed" page. BUT, whenever I load my database library in autoload.php or load it in above model, code fails.
Autoload.php
$autoload['libraries'] = array('database');
Apache error logs showed below errors but I could not figure as why this was happening.
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\php\\ext\\php_mysqli.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\\php\\ext\\php_pdo_mysql.dll' - The specified module could not be found.\r\n in Unknown on line 0
Please advise.
EDIT:
I verified all config to be OK and as stated in the comments, I added environment variables to windows and verified through PHPInfo that mysqli and mysqlnd were loaded.
Despite getting all the config right, error still persisted and I did a clean install of CI to reproduce library load failure. This time CI returned an error that db access was denied.
I then realized that after migration, database user was not created in the new environment. So once I created the desired user and assigned it required privileges, I was able to run the code just fine.
Therefore, if anyone encounters such issue in future, below steps might help:
First and foremost, verify if your desired user can access the
database.
Modify your .htaccess to use your desired URL schemes only after
verifying that database connection is working
Then verify that absolute path is available in PHP.ini on XAMPP.
Plus, verify that PHP is added in the environment variables. My
Values on Windows 10 are as follows: Variable Name: PHP , Variable
Value: C:\xampp\php\ext
In CI, mysqli is selected as database driver
In PHP.ini mysqli extension is enabled. i.e. php_mysqli.dll
Echo PHPInfo to verify that mysqli and mysqlnd are available in your
installation.
If nothing works, do a clean install of CI on a separate directory and load database library after setting up your database configuration and before setting up .htaccess until you can reproduce the error.
Hope that error will be eliminated!

Unable to find the socket transport "ssl"

I'm trying to figure out "why" I'm getting an error message from the Joomla 3.X component Gcalendar (google calendar). The error message is below.
Error Unable to Connect to ssl://www.google.com:443. Error
#-912967449: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?
I have read several other threads on here and other sites but most outline 'how' to enable/install/etc... SSL. I've copied/pasted the info.php data into a google doc here. Everything dealing with SSL is labeled as 'on' or 'installed.
The server is not 'public' right now, it is only available from within the school district's network. Could this be the reason for the problem?
Any ideas anyone?
ssl://www.google.com:443
should be
https://www.google.com:443
I just had this error as well. In my case it was because I was working locally, not on the live site. Once I put it live, it worked fine. Just putting this here in case anyone else comes across the same thing.
Install OpenSSL module for php:
1. In the php.ini file,
add this line "extension = php_openssl.dll"
2.Make sure that the folder "ext" have this dll,
if not then add the desired version.
Установить для php модуль OpenSSL:
1)В файле php.ини,
добавь строку "extension=php_openssl.dll"
2) Убедись что в папке "ext" есть эта dll,
если нет то добавте необходимой версии.

in wordpress, a valid callback for cp_admin_init and _canonical_charset

I'm using WordPress 3.5 with child-theme of Twenty Eleven 1.5. Suddenly I'm getting following Warning,
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'cp_admin_init' was given in /home/templ/public_html/wp-includes/plugin.php on line 406
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, '_canonical_charset' was given in /home/templ/public_html/wp-includes/plugin.php on line 173
I'm using following plugins:
download-manager 2.3.9
wordpress-seo 1.4.7
wp-pagenavi 2.83
Some more points:
1) If I'm giving mysite.com it's giving above 2 line warning. If I give www.mysite.com, the following line also include,
Warning: Cannot modify header information - headers already sent by (output started at /home/templ/public_html/wp-includes/plugin.php:406) in /home/templ/public_html/wp-includes/pluggable.php on line 876
2) If I give mysite.com/wp-admin/ or www.mysite.com/wp-admin/, It's giving 1st warning and 3rd warning.
3) If I goto www.mysite.com/wp-login.php, It's giving following 5 warning.
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'cp_admin_init' was given in /home/templ/public_html/wp-includes/plugin.php on line 406
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, '_canonical_charset' was given in /home/templ/public_html/wp-includes/plugin.php on line 173
Warning: Cannot modify header information - headers already sent by (output started at /home/templ/public_html/wp-includes/plugin.php:406) in /home/templ/public_html/wp-login.php on line 368
Warning: Cannot modify header information - headers already sent by (output started at /home/templ/public_html/wp-includes/plugin.php:406) in /home/templ/public_html/wp-login.php on line 380
Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'wp_authenticate_spam_check' was given in /home/templ/public_html/wp-includes/plugin.php on line 173
4) If I give correct username and password, it's not going to login. giving following problem,
ERROR: Invalid username or incorrect password.
ERROR: Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.
I'm trying to find solution. I can't. Can any-one help me?
This sounds like a corrupted install. So you have a few options to fix this:
Attempt to get logins operational again and doing an upgrade though the wp-admin: Explained Below.
Do a manual Update: http://codex.wordpress.org/Updating_WordPress#Manual_Update
But First: Make a Backup
Please be sure to backup your install! Before proceeding: http://codex.wordpress.org/WordPress_Backups
Getting Logins Working: Masking the symptoms
First I would disable debugging output because that should fix most of these issues. When a warning occurs in Wordpress, PHP starts writing the response body and closes the header section of the response. This means that whenever Wordpress tries to add another header after the original warning was raised, PHP will raise another warning:
Warning: Cannot modify header information - headers already sent by (output started at /home/templ/public_html/wp-includes/plugin.php:406) in /home/templ/public_html/wp-login.php on line 380
So if we disable debugging then we should be able to mask the symptoms. This is a quick patch for a larger problem that we will have to solve with an in-place upgrade
To Disable Debugging
Ensure that the following constants exist and are set correctly is in your wp-config.php file
define('WP_DEBUG', false);
and
define('WP_DEBUG_DISPLAY', false);
Now you should be able to login to your site as an administrator without errors.
Disable your Plugins
Disable all your plugins in Plugins -> Installed Plugins This is imperative so that we can make sure that the update goes smoothly.
Do an Update
Go to Dashboard -> Updates and click either Update Now or Re-install Now
Reactivate your Plugins
Reactivate all your plugins in Plugins -> Installed Plugins and update them if necessary.
That's It
That's the process for reinstalling Wordpress. The key here is that you have Debugging enabled on a production site which is not good. You should always have WP_DEBUG and WP_DEBUG_DISPLAY set to false in a production environment.

Migrating Authorization Mechanics ClientLogin to OAuth2 Google AdWords v201206 Perl

So I previously was using ClientLogin for authorization in the Google AdWords API but after looking at AuthForInstalledApps it says that this mechanism has been deprecated in favor of OAuth2.0
I have registered my application in the API Consoles. Now I am trying to follow the perl example of how to set this up:
use_oauth2.pl
I cannot place the AdWords Client, credentials in ~/adwords.properties since I have multiple accounts that I will be doing Campaign Management operations on, and therefore multiple client ids.
But for now I tried to follow this example by using just one of my client's info like this:
my $client = Google::Ads::AdWords::Client->new(
{
version => 'v201206',
developer_token => TOKEN,
client_id => $google_account_id
}
);
$client->get_auth_token_handler()->set_email($login);
$client->get_auth_token_handler()->set_password($password);
However when I step through this, when it tries to initialize the Client object it throws this error:
Can't use an undefined value as a HASH reference at (eval 845)[/usr/lib/perl5/vendor_perl/5.8.8/HTTP/Message.pm:371] line 1. at (eval 845)[/usr/lib/perl5/vendor_perl/5.8.8/HTTP/Message.pm:371] line 1
HTTP::Message::__ANON__[(eval 845)[/usr/lib/perl5/vendor_perl/5.8.8/HTTP/Message.pm:371]:1]() called at /home/etienne/backend/libs/Google/Ads/Common/HTTPTransport.pm line 30
Google::Ads::Common::HTTPTransport::client('Google::Ads::Common::HTTPTransport=HASH(0xb59b830)', 'Google::Ads::AdWords::Client=SCALAR(0x9b9bb60)') called at /home/etienne/backend/libs Google/Ads/AdWords/Client.pm line 180
Google::Ads::AdWords::Client::START('Google::Ads::AdWords::Client=SCALAR(0x9b9bb60)', 1, 'HASH(0xb582e70)') called at /usr/lib/perl5/site_perl/5.8.8/Class/Std/Fast.pm line 251
Class::Std::Fast::__ANON__[/usr/lib/perl5/site_perl/5.8.8/Class/Std/Fast.pm:252]() called at /usr/lib/perl5/site_perl/5.8.8/Class/Std/Fast.pm line 287
Class::Std::Fast::new('Google::Ads::AdWords::Client', 'HASH(0xb54c210)') called at /home/etienne/backend/search_marketing/data_exchange/lib/GoogleAPIv2.pm line 3555
GoogleAPIv2::get_adwords_client('GoogleAPIv2=HASH(0xb556d10)', 4202697829) called at /home/etienne/backend/search_marketing/data_exchange/lib/GoogleAPIv2.pm line 230
GoogleAPIv2::add_campaign('GoogleAPIv2=HASH(0xb556d10)', 'name', 'API Upgrade Test Campaign - 1348613850', 'google_account_id', 4202697829, 'account_id', 207, 'country_code', 'US', ...) called at google_add_campaign.t line 110
main::main() called at google_add_campaign.t line 26
scalar context return from CODE(0x9b909c0): *Class::Std::Fast::_cache
1..3
I am using Perl v5.8.8 . I have installed the latest Adwords Perl Client Library v2.7.2 . Is there some kind of dependency issue?
And how can I go about resolving this issue. Any information you can provide would be very helpful. Thanks.
It looks like I just needed to have the latest HTTP/Message.pm v6.0.3 module installed since the version I had installed did not have the method decode() which was being passed to the AUTOLOAD() subroutine in the HTTP/Message.pm module.

Zend_Form doesn't load on deployment

Can't figure this one out. It worked in my local environment. Everything is at the right place but the server still can't find it:
**Warning: include_once(Zend/Form/Element/TextArea.php) [function.include-once]: failed to open stream: No such file or directory in /is/htdocs/xxxx/www/mensenenjij/library/Zend/Loader.php on line 146
Warning: include_once() [function.include]: Failed opening 'Zend/Form/Element/TextArea.php' for inclusion (include_path='/is/htdocs/xxxx/www/mensenenjij/application/../library:/is/htdocs/xxxx/www/mensenenjij/library:.:/usr/share/pear/php5') in /is/htdocs/xxxx/www/mensenenjij/library/Zend/Loader.php on line 146
Fatal error: Class 'Zend_Form_Element_TextArea' not found in /is/htdocs/xxxx/www/mensenenjij/library/Mensenenjij/Form/Contact.php on line 52**
Thanks
I'm assuming by the class it's trying to load, you're using Windows on your local env, and a Linux distro on your deployment server?
If you are, Linux is case sensitive. Try using Zend_Form_Element_Textarea instead.