As an alternative to /opt/lampp/bin/php, to run a php script from the command line, you just need to install php5-cli:
sudo apt-get install php5-cli
And run your script with:
php myscript.php
To open an interactive php shell, just type in a terminal:
如果想在terminal里面直接写php,可以用:
php -a
本文:linux: 命令行运行php Run PHP from the command line… Read More
I am running a Magento Store and have created a seperate login outside of the root folder. I moved the store from Bluehost to Rackspace cloud and now I get this message when trying to login
Fatal error: Uncaught exception ‘Mage_Core_Exception’ with message ‘Invalid login or password.’ in myDomain/store/app/Mage.php:536 Stac… Read More
This tutorial shows how to resolve the Magento admin panel login issue.
It’s a common issue: you are trying to login to the Magento admin panel, typed your username and password, clicked Login button and nothing happens. The page refreshes and that’s all. No error or any other messages.
This is caused by the cookies issue. In
For the impatient: the short version …
For those that are impatient and more experienced, you can follow the following steps quickly.
For beginners I recommend to continue reading the following paragraphs which explain a little bit more about what’s happening.
Install HandBrake.
Install codecs and libdvdcss (see below).
Start HandBrake.
Insert DVD.… Read More
Perfect differece with example for getsingleton and getmodel.
Mage::getSingleton()
Mage::getSingleton() will first check if the same class instance exists or not in the memory. If the instance exists then it will return the same object from the memory. So Mage::getSingleton() is faster than Mage::getModel().
Example
$product1 = Mage::getSingleto… Read More
1. 获取已登录客户信息
// Check if any customer is logged in or not
if (Mage::getSingleton('customer/session')->isLoggedIn()) {
// Load the customer's data
$customer = Mage::getSingleton('customer/session')->getCustomer();
$customer->getPrefix();
$customer->getName(); // Full Name
$customer->getFirstname(); // First Name
$cu… Read More
Magento uses MD5 and salt algorithems to store password for customer as well admin user.
How magento create encrypted password
Magento create encrypted password with,
Mage::getModel('core/encryption')->decrypt($password);
Here is the logic of decrypt($password) function,
$password = "12345678";
$salt = "at";
$encyPasswod = md5($salt.$pa… Read More