Today I will show you how to get current module, controller and action name in Zend Framework. In the default routing, both the module, controller and the action are always passed along with the request. And the code to retrieve them is very simple:
$moduleName = $this->getRequest()->getModuleName();
$controllerName = $this->getRequest()->getControllerName();
$actionName = $this->getRequest()->getActionName();
And that’s all. Good luck.
Posted in Php
, Zend Framework
at July 27th, 2011. No Comments
Today I will show you how to install virtual hosts on Wamp server.
First open your hosts file, you can find it in this folder:
to edit it you need to have administrator permissions.
After this line:
add new one with name of your domain:
I prefer to use .local for my virtual domains to know is that virtual or real domain name.
Next step is to open httpd.conf file which is locate in:
find this line:
# Virtual hosts
# Include conf/extra/httpd-vhosts.conf
to enable httpd-vhosts.conf just remove # at the begin of the row. After this open httpd-vhosts.conf for edit.
Options Indexes MultiViews FollowSymLinks
Allow from 127.0.0.1
Restart your Wamp server and type in your browser test.local .
Posted in Apache
at July 8th, 2011. No Comments
The main benefit of APC is to increase the performance of PHP scripts.
How to install APC on WAMP 2.1:
1) Go to http://downloads.php.net/pierre/
2) Download php_apc-3.1-svn20101116-5.3-vc6-x86.zip
3) Copy php_apc.dll to \wamp\bin\php\php5.3.5\ext
4) Enable php_apc extension from WAMP server panel -> PHP extensions
5) Open php.ini \wamp\bin\apache\Apache2.2.17\bin and add this:
apc.enabled = 1
apc.shm_segments = 1
apc.shm_size = 64M
apc.max_file_size = 10M
apc.stat = 1
6) Restart Wamp server
7) Open this address http://localhost/?phpinfo=1 in your favourite browser
And check for this section:
If you see that section, then everything is ok and you successfully installed APC extension on your WAMP server.
I add new article for WAMP 64bit with APC, you can found it here 64bit wamp
Posted in Php
at July 6th, 2011. 28 Comments