I was getting the error "HTTP/1.0 302 Found" when trying to configure some old PayPal IPN code that I had in PHP.
So I found on this forum that what I needed to do was open my paypal.inc.php file and change the following line:
$fp= @ fsockopen($this->paypalurl,80,$errno,$errstr,30);
to this one:
$fp = fsockopen('ssl://'.$this->paypalurl,"443",$err_num,$err_str,30);
Looks like the PayPal IPN is not taking non SSL connections anymore?
Programming solutions, source code, solutions to tech problems and other tech related stuff.
Showing posts with label php. Show all posts
Showing posts with label php. Show all posts
Monday, November 28, 2011
Tuesday, November 22, 2011
Yii. Rbac. No such file or directory (trying to connect via unix:///var/mysql/mysql.sock
To resolve the error in the title of this post:
1. Set the following in "/etc/php.ini"
pdo_mysql.default_socket=/tmp/mysql.sock
mysql.default_socket = /tmp/mysql.sock
mysqli.default_socket = /tmp/mysql.sock
2. Comment out the following line in "/protected/config/main.php" of your app:
'ipFilters'=>array('localhost','::1'),
3. Restart Apache:
sudo apachectl restart
1. Set the following in "/etc/php.ini"
pdo_mysql.default_socket=/tmp/mysql.sock
mysql.default_socket = /tmp/mysql.sock
mysqli.default_socket = /tmp/mysql.sock
2. Comment out the following line in "/protected/config/main.php" of your app:
'ipFilters'=>array('localhost','::1'),
3. Restart Apache:
sudo apachectl restart
Friday, November 11, 2011
PHP Warning: session_start() [function.session-start]: Cannot send session cache limiter
session_start() must go on the very first line of your php file.
Sunday, September 18, 2011
AdSense-Deluxe Plugin for WordPress: You do not have sufficient permissions to access this page.
I tried installing the AdSense-Deluxe Plugin for Wordpress and I was getting the error:
"You do not have sufficient permissions to access this page."
What I did to solve this was:
1. Open the file "adsense-deluxe.php"
2. Search for the line: "add_action('admin_head', 'add_adsense_deluxe_menu');"
3. Place the following line before it:
add_action('admin_menu', 'add_adsense_deluxe_menu');
4. Find any place where the variable $action_url is used. Replace it with:
adsense-deluxe_wp_plugin_v0.8/adsense-deluxe.php
Then it should work properly. Woo...
"You do not have sufficient permissions to access this page."
What I did to solve this was:
1. Open the file "adsense-deluxe.php"
2. Search for the line: "add_action('admin_head', 'add_adsense_deluxe_menu');"
3. Place the following line before it:
add_action('admin_menu', 'add_adsense_deluxe_menu');
4. Find any place where the variable $action_url is used. Replace it with:
adsense-deluxe_wp_plugin_v0.8/adsense-deluxe.php
Then it should work properly. Woo...
Saturday, June 25, 2011
Suppress "Warning: MagpieRSS: Failed to parse RSS file."
If for some reason you really want to suppress this error:
1. Find the file rss_fetch.inc. In my case it was inside the folder "/magpierss-0.72/"
2. Search for the text "Failed to parse RSS file"
3. Comment out the following line:
error($errormsg);
That should do the trick. A dirty fix, but a fix nontheless.
1. Find the file rss_fetch.inc. In my case it was inside the folder "/magpierss-0.72/"
2. Search for the text "Failed to parse RSS file"
3. Comment out the following line:
error($errormsg);
That should do the trick. A dirty fix, but a fix nontheless.
Saturday, March 26, 2011
Unsafe JavaScript attempt to access frame with URL
Getting a "Unsafe JavaScript attempt to access frame with URL" message in Chrome when trying something dodgy across domains or subdomains with iframes?
It is pretty much a browser security feature. So there's no way it is going to work.
Eventually I settled for doing everything from within an iframe.
It is pretty much a browser security feature. So there's no way it is going to work.
Eventually I settled for doing everything from within an iframe.
Sunday, March 20, 2011
Cannot access empty property PHP
Don't use the '$' when accessing a member variable. i.e.:
Wrong:
$MYTHING->$dbhost = 'localhost';
Correct:
$MYTHING->dbhost = 'localhost';
Wrong:
$MYTHING->$dbhost = 'localhost';
Correct:
$MYTHING->dbhost = 'localhost';
Monday, March 14, 2011
PayPal IPN not working in sandbox
So I was testing the IPN with the PayPal Sandbox and it was just refusing to trigger the IPN at all.
In the end, after some hardcore Googling, I realized that it was because the test account I created in the Sandbox was not 'Verified.'
So I tried verifying the email by looking at the sandbox emails under the link 'Test Email.' However, that didn't accept my password.
I had to take another step, which was to 'automatically' verify the US account by adding a bank account to the account.
To do this:
1. I logged on to the sandbox by using the test account
2. Clicked on 'profile->add bank account' (a set of fake bank account numbers should be autofilled).
3. Verified the account by entering two random digits into the verification screen. (I entered 0.01 and 0.01).
4. Then I was able to test my transaction and the IPN worked from the sandbox. Great stuff.
In the end, after some hardcore Googling, I realized that it was because the test account I created in the Sandbox was not 'Verified.'
So I tried verifying the email by looking at the sandbox emails under the link 'Test Email.' However, that didn't accept my password.
I had to take another step, which was to 'automatically' verify the US account by adding a bank account to the account.
To do this:
1. I logged on to the sandbox by using the test account
2. Clicked on 'profile->add bank account' (a set of fake bank account numbers should be autofilled).
3. Verified the account by entering two random digits into the verification screen. (I entered 0.01 and 0.01).
4. Then I was able to test my transaction and the IPN worked from the sandbox. Great stuff.
Sunday, February 06, 2011
Output XML with PHP
Something to get you started with php and xml. Complete with get request and xml header:
<?php
header('Content-Type: text/xml');
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
?>
<?php
$getrequestparam1 = $_GET["getrequestparam1"];
echo "\n<result>No Results Found for $getrequestparam1</result>";
?>
<?php
header('Content-Type: text/xml');
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
?>
<?php
$getrequestparam1 = $_GET["getrequestparam1"];
echo "\n<result>No Results Found for $getrequestparam1</result>";
?>
Monday, December 13, 2010
Warning: include() [function.include]: URL file-access is disabled in the server configuration
I too, was getting the error:
Warning: include() [function.include]: URL file-access is disabled in the server configuration
For my include file.
Using "Allow_url_include = On" in my php.ini file was not an option for me, since I was using a cpanel on some third part web host. (Allow_url_include is kind of a bad thing to do anyway, since it means other hosts can link to your file and steal your code).
However, this site taught me how to solve it: http://blog.everymanhosting.com/php-coding/warning-include-functioninclude-url-file-access-is-disabled-in-the-server-configuration/
The option that worked for me was:
require_once($_SERVER['DOCUMENT_ROOT'].'/file.php');
Warning: include() [function.include]: URL file-access is disabled in the server configuration
For my include file.
Using "Allow_url_include = On" in my php.ini file was not an option for me, since I was using a cpanel on some third part web host. (Allow_url_include is kind of a bad thing to do anyway, since it means other hosts can link to your file and steal your code).
However, this site taught me how to solve it: http://blog.everymanhosting.com/php-coding/warning-include-functioninclude-url-file-access-is-disabled-in-the-server-configuration/
The option that worked for me was:
require_once($_SERVER['DOCUMENT_ROOT'].'/file.php');
Thursday, September 23, 2010
Symfony PHP Fatal error: Class 'myUser' not found in /home/
PHP Fatal error: Class 'myUser' not found in /home/
This happened for some strange reason.
The way to fix it was to delete everything in the 'cache/frontend' folder.
This happened for some strange reason.
The way to fix it was to delete everything in the 'cache/frontend' folder.
Wednesday, April 28, 2010
Cannot find config.m4 when installing eAccelerator
If you are following the instructions on this site:
http://developer.mindtouch.com/en/kb/Improve_PHP_performance_with_eAccelerator_on_Ubuntu_8.04_(Debian)
It is likely you're not in the correct directory. Go back to eaccelerator-0.9.5.3
cd /tmp/eaccelerator-0.9.5.3
then you should be able to run:
sudo phpize
http://developer.mindtouch.com/en/kb/Improve_PHP_performance_with_eAccelerator_on_Ubuntu_8.04_(Debian)
It is likely you're not in the correct directory. Go back to eaccelerator-0.9.5.3
cd /tmp/eaccelerator-0.9.5.3
then you should be able to run:
sudo phpize
Monday, March 22, 2010
Remove 'My Talk' and User Page in Mediawiki
1. Find the file 'includes/SkinTemplate.php'
2. Search for the function "function buildPersonalUrls()"
3. Comment out accordingly, i.e.
/*$personal_urls['userpage'] = array(
'text' => $this->username,
'href' => &$this->userpageUrlDetails['href'],
'class' => $this->userpageUrlDetails['exists']?false:'new',
'active' => ( $this->userpageUrlDetails['href'] == $pageurl )
);*/
$usertalkUrlDetails = $this->makeTalkUrlDetails($this->userpage);
/*$personal_urls['mytalk'] = array(
'text' => wfMsg('mytalk'),
'href' => &$usertalkUrlDetails['href'],
'class' => $usertalkUrlDetails['exists']?false:'new',
'active' => ( $usertalkUrlDetails['href'] == $pageurl )
);*/
$href = self::makeSpecialUrl( 'Preferences' );
$personal_urls['preferences'] = array(
'text' => wfMsg( 'mypreferences' ),
'href' => $href,
'active' => ( $href == $pageurl )
);
$href = self::makeSpecialUrl( 'Watchlist' );
$personal_urls['watchlist'] = array(
'text' => wfMsg( 'mywatchlist' ),
'href' => $href,
'active' => ( $href == $pageurl )
);
2. Search for the function "function buildPersonalUrls()"
3. Comment out accordingly, i.e.
/*$personal_urls['userpage'] = array(
'text' => $this->username,
'href' => &$this->userpageUrlDetails['href'],
'class' => $this->userpageUrlDetails['exists']?false:'new',
'active' => ( $this->userpageUrlDetails['href'] == $pageurl )
);*/
$usertalkUrlDetails = $this->makeTalkUrlDetails($this->userpage);
/*$personal_urls['mytalk'] = array(
'text' => wfMsg('mytalk'),
'href' => &$usertalkUrlDetails['href'],
'class' => $usertalkUrlDetails['exists']?false:'new',
'active' => ( $usertalkUrlDetails['href'] == $pageurl )
);*/
$href = self::makeSpecialUrl( 'Preferences' );
$personal_urls['preferences'] = array(
'text' => wfMsg( 'mypreferences' ),
'href' => $href,
'active' => ( $href == $pageurl )
);
$href = self::makeSpecialUrl( 'Watchlist' );
$personal_urls['watchlist'] = array(
'text' => wfMsg( 'mywatchlist' ),
'href' => $href,
'active' => ( $href == $pageurl )
);
Thursday, February 18, 2010
PHP5/Apache mysql.so in ubuntu
For my own reference:
1. apt-get install php5-mysql
2. sudo gedit /etc/php5/apache2/php.ini
3. add "extension=mysql.so"
1. apt-get install php5-mysql
2. sudo gedit /etc/php5/apache2/php.ini
3. add "extension=mysql.so"
Tuesday, February 16, 2010
php5apache2.dll is missing from my install
Indeed it is.
Especially in a particular case I had with Apache 2.0.63 & Windows.
So, I learned:
1. You need to make sure your PHP installer has "VC6" in the name and not "VC9" (as that's for IIS servers).
and
2. It needs to be the thread safe version.
3. Also, I couldn't get PHP 5.3.1 to work with Apache 2.0.63 at all. No matter which dll file I used. So I downloaded the zip of 5.2.12 (php-5.2.12-Win32-VC6-x86.zip), extracted it to C:\PHP and configured: LoadModule php5_module "c:/PHP/php5apache2.dll" in my httpd.conf.
This site helped at some point too.
Then all was fine.
Especially in a particular case I had with Apache 2.0.63 & Windows.
So, I learned:
1. You need to make sure your PHP installer has "VC6" in the name and not "VC9" (as that's for IIS servers).
and
2. It needs to be the thread safe version.
3. Also, I couldn't get PHP 5.3.1 to work with Apache 2.0.63 at all. No matter which dll file I used. So I downloaded the zip of 5.2.12 (php-5.2.12-Win32-VC6-x86.zip), extracted it to C:\PHP and configured: LoadModule php5_module "c:/PHP/php5apache2.dll" in my httpd.conf.
This site helped at some point too.
Then all was fine.
Sunday, November 01, 2009
Zen cart Configuration and Email Options or Transport Not Showing
I thought I'd post this, since it just took up the last few hours of my day trying to figure it out.
The problem was that in my zencart installation on a windows machine I was getting nothing displayed when I clicked on any of the options in the configuration section of the admin panel.
Eventually, I found a fix at the strangest of places. I found the following line in "admin\configuration.php"
$configuration = $db->Execute("select configuration_id, configuration_title, configuration_value, configuration_key,
use_function from " . TABLE_CONFIGURATION . "
where configuration_group_id = '" . (int)$gID . "'
order by sort_order");
Then changed it to:
$configuration = $db->Execute("select configuration_id, configuration_title, configuration_value, configuration_key,
use_function from " . TABLE_CONFIGURATION . "
where trim(configuration_group_id) = '" . (int)$gID . "'
order by sort_order");
As you may notice, I used a trim function on the trim(configuration_group_id) then everything worked fine.
It seems that the mysql version that I am using might not be the smoothest to use for zencart, but all is working for now. So I will see how things go.
The problem was that in my zencart installation on a windows machine I was getting nothing displayed when I clicked on any of the options in the configuration section of the admin panel.
Eventually, I found a fix at the strangest of places. I found the following line in "admin\configuration.php"
$configuration = $db->Execute("select configuration_id, configuration_title, configuration_value, configuration_key,
use_function from " . TABLE_CONFIGURATION . "
where configuration_group_id = '" . (int)$gID . "'
order by sort_order");
Then changed it to:
$configuration = $db->Execute("select configuration_id, configuration_title, configuration_value, configuration_key,
use_function from " . TABLE_CONFIGURATION . "
where trim(configuration_group_id) = '" . (int)$gID . "'
order by sort_order");
As you may notice, I used a trim function on the trim(configuration_group_id) then everything worked fine.
It seems that the mysql version that I am using might not be the smoothest to use for zencart, but all is working for now. So I will see how things go.
Zen cart Configuration and Email Options or Transport Not Showing
I thought I'd post this, since it just took up the last few hours of my day trying to figure it out.
The problem was that in my zencart installation on a windows machine I was getting nothing displayed when I clicked on any of the options in the configuration section of the admin panel.
Eventually, I found a fix at the strangest of places. I found the following line in "admin\configuration.php"
$configuration = $db->Execute("select configuration_id, configuration_title, configuration_value, configuration_key,
use_function from " . TABLE_CONFIGURATION . "
where configuration_group_id = '" . (int)$gID . "'
order by sort_order");
Then changed it to:
$configuration = $db->Execute("select configuration_id, configuration_title, configuration_value, configuration_key,
use_function from " . TABLE_CONFIGURATION . "
where trim(configuration_group_id) = '" . (int)$gID . "'
order by sort_order");
As you may notice, I used a trim function on the trim(configuration_group_id) then everything worked fine.
It seems that the mysql version that I am using might not be the smoothest to use for zencart, but all is working for now. So I will see how things go.
The problem was that in my zencart installation on a windows machine I was getting nothing displayed when I clicked on any of the options in the configuration section of the admin panel.
Eventually, I found a fix at the strangest of places. I found the following line in "admin\configuration.php"
$configuration = $db->Execute("select configuration_id, configuration_title, configuration_value, configuration_key,
use_function from " . TABLE_CONFIGURATION . "
where configuration_group_id = '" . (int)$gID . "'
order by sort_order");
Then changed it to:
$configuration = $db->Execute("select configuration_id, configuration_title, configuration_value, configuration_key,
use_function from " . TABLE_CONFIGURATION . "
where trim(configuration_group_id) = '" . (int)$gID . "'
order by sort_order");
As you may notice, I used a trim function on the trim(configuration_group_id) then everything worked fine.
It seems that the mysql version that I am using might not be the smoothest to use for zencart, but all is working for now. So I will see how things go.
Saturday, October 31, 2009
How to run PHP in a Tomcat server instance
One of the very few tutorials that actually works, thanks to the blog pointing to both a download for PHP and PECL libraries that match each other:
How to Run PHP 5.x with Apache Tomcat 4.x or Apache Tomcat 5.x @ AurosBlog
How to Run PHP 5.x with Apache Tomcat 4.x or Apache Tomcat 5.x @ AurosBlog
Thursday, April 16, 2009
Ubuntu Install PEAR Mail for PHP / sending mail in Ubuntu via PHP
If you're getting some sort of 'php unable to load dynamic library' problem in PHP while trying to send email with PEAR/PHP on Ubuntu you'll probably need to do the following to install pear:
sudo apt-get install php-pear
sudo pear install mail
sudo pear install Net_SMTP
sudo pear install Auth_SASL
sudo pear install mail_mime
sudo apt-get install php-pear
sudo pear install mail
sudo pear install Net_SMTP
sudo pear install Auth_SASL
sudo pear install mail_mime
Subscribe to:
Posts (Atom)