April 20th, 2011
I encountered this problem after I upgraded httpd to 2.2.3 by yum under CentOS 5. After hours of research, I finally got the solution.
(source: http://philipalex23.blogspot.com/2011/04/cgi-files-showing-500-internal-server.html)
If you getting 500 internal server while executing the CGI files then please check the error log of that particular domain
eg: /var/www/vhosts/domain.com/statistics/logs/error_log
1) The error log may be showing issue with suexec policy violation: see suexec log for more details
>> Then please check the suexec log in /etc/httpd/logs/suexec.log their you will get error like below
target uid/gid (10078/505) mismatch with directory (10078/504) or program (10078/505)
Fix: /bin/cp /usr/sbin/psa-suexec /usr/sbin/suexec
OR
cp -arf /usr/local/psa/suexec/psa-suexec /usr/sbin/suexec
restart the Apache and try to load the cgi file.
(Reason: Plesk uses it’s own suexec file and it might have been replaced by the original one that comes with standard apache package. )
2) In the error log if you getting this error : Premature end of script headers:
Fix: Make sure that the cgi-bin/ folder has the following permissions and ownership:
drwxr-x— myuser psaserv cgi-bin
The script itself must be owned by domain FTP user but group must be ‘psacln’:
-rwxr-xr-x myuser psacln script.cgi
The permission should be 755 for your script.cgi file.
Posted in IT, PHP | No Comments »
March 2nd, 2011
Override magento\app\code\core\Mage\Catalog\Model\Product\Option\Type\File.php
change line 145/179 according to your version of magento, from :
if (!$upload->receive()) {
to
if (!$upload->receive($file)) {
Tags: Custom Option, File upload, Magento
Posted in Magento | No Comments »
March 1st, 2011
get associated products attributes http://www.magentocommerce.com/boards/viewthread/73735/
stock status of associated products http://www.magentocommerce.com/boards/viewthread/24607/P15/
just for future reference
Posted in Magento | No Comments »
February 28th, 2011
iptables -A INPUT -p tcp -s 0.0.0.0/0 –dport 80 -m string –string “w00t” –algo bm -j DROP
Posted in IT | No Comments »
February 25th, 2011
$productOptions = $item->getProduct()->getTypeInstance(true)->getOrderOptions($item->getProduct());
I found this on Magento Forum. Saved me lots of time on a new project.
Posted in Magento | No Comments »
February 25th, 2011
I need to calculate the price for some highly configurable products in Magento. I’ve spent hours on how to pass the price to the cart, because no matter what I do, the cart always show the price in the database instead of the calculated one.
Finally, I’ve got one solution. I am not sure if it’s the right way to do it, but it works !
For the others who are looking, here’s where you can start:
Modify app/code/core/Mage/Sales/Model/Quote/Address/Total/Subtotal.php. The function _initItem is what you are looking for. Read the code, then you’ll know what you have to do.
Enjoy coding, folks!!
Tags: Calculate Price, Configurable Product, Customize, Magento
Posted in Magento | No Comments »
February 12th, 2011
IEs are always the pain in the ass for developers and web designs…. sigh
just ran into a z-index related problem earlier today. the menu works fine in Firefox, Chrome, Safari, ie6(!!?) and ie8, but not ie7. after googled a little, I found that it’s a “Feature” of IE7 (of course).
OK. Long story short, when use position-absolute and z-index together in a container, remember to add position-relative and a higher z-index in its parent container.
IE MUST DIE!!!
Posted in CSS | No Comments »
January 1st, 2011
Thanks to My Dev Life!, I finally set my symfony project up and running.
The KEY is to keep in mind that
Plesk actually generates TWO conf/ directories, one in /var/www/vhosts/mydomain.com/conf and one in /var/www/vhosts/mydomain.com/subdomains/yoursubdomain/conf . When creating and publishing a web page you use the /mydomain.com/yoursubdomain directory, but Plesk uses the /mydomain.com/yoursubdomain/conf directory for all the vhosts configuration, so you have to put the vhosts.conf under that directory.
This is the vhosts.conf source that I’m using and it works:
DocumentRoot "/var/www/vhosts/mydomain.com/subdomain/web"
DirectoryIndex index.php
ServerName subdomain.mydomain.com
<Directory "/var/www/vhosts/mydomain.com/subdomain/web">
AllowOverride All
Allow from All
</Directory>
Alias /sf "/var/www/vhosts/mydomain.com/subdomain/lib/vendor/symfony/data/web/sf"
<Directory "/var/www/vhosts/mydomain.com/subdomain/lib/vendor/symfony/data/web/sf">
AllowOverride All
Allow from All
</Directory>
After you’ve saved vhosts.conf file, type and run /usr/local/psa/admin/sbin/httpdmng –reconfigure-domain mydomain.com
Posted in PHP | No Comments »
December 28th, 2010
a:5:{i:0;s:141:”Strict Notice: Only variables should be passed by reference in /var/www/vhosts/xxxxxx.com/httpdocs/lib/Zend/Db/Select.php on line 246″;i:1;s:6588:”#0 /var/www/vhosts/xxxxxx.com/httpdocs/lib/Zend/Db/Select.php(246): mageCoreErrorHandler(2048, ‘Only variables …’, ‘/var/www/vhosts…’, 246, Array)
Find the file in your web root: lib/Zend/Db/Select.php
REPLACE LINE 246:
$correlationName = current(array_keys($this->_parts[self::FROM]));
WITH:
$arrayKeys = array_keys($this->_parts[self::FROM]);
$correlationName = current($arrayKeys);
This error happened when I migrate my magento site from a shared hosting service to my dedicated server. If you’re using e-accelerator, then it’s an acknowedged bug by the zend team.
Posted in IT, Magento, PHP | No Comments »