After upgrade the apache to 2.4, the virtual host does not work and returns the following error.
AH01630: client denied by server configuration
Solution:
Need to add the following line to resolve the error.
<VirtualHost *:90>
ServerAdmin xxx@gmail.com
DocumentRoot "X:/XXX/XXX"
<Directory X:/XXX/XXX />
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
Require all granted
</Directory>
ErrorLog "logs/error.log"
CustomLog "logs/access.log" common
</VirtualHost>
My PHP Development
PHP, jQuery, Drupal, Apache, Zend Framework
2014年2月9日 星期日
2014年1月26日 星期日
[Resolved] Smarty: Uncaught exception: SmartyException with message Call of unknown method config_load
Tried to load the configuration file but not succeed..
Fatal error: Uncaught exception SmartyException with message Call of unknown method config_load in X:\XXX\smarty\sysplugins\smarty_internal_templatebase.php:806 Stack trace: #0
Smarty_Internal_TemplateBase->__call('config_load', Array)#
Smarty->config_load(...) #2
require_once(...) #3 {main} thrown in
X:\XXX\smarty\sysplugins\smarty_internal_templatebase.php on line 806
Solution
The error was caused by the template cache, remove it and try again.
Fatal error: Uncaught exception SmartyException with message Call of unknown method config_load in X:\XXX\smarty\sysplugins\smarty_internal_templatebase.php:806 Stack trace: #0
Smarty_Internal_TemplateBase->__call('config_load', Array)#
Smarty->config_load(...) #2
require_once(...) #3 {main} thrown in
X:\XXX\smarty\sysplugins\smarty_internal_templatebase.php on line 806
Solution
The error was caused by the template cache, remove it and try again.
[Resolved] Smarty Fatal error: Call to undefined function config_load(): fail to load configuration file
In Smarty3, tried to load the configuration file in php but not success.. it returns the error message of
Call to undefined function config_load()
The PHP code is as below:
$smarty = new Smarty ();
$smarty->config_load("test.conf");
Solution:
The load configuration function should be configLoad, instead of config_load.
$smarty = new Smarty ();
$smarty->configLoad("test.conf");
Call to undefined function config_load()
The PHP code is as below:
$smarty = new Smarty ();
$smarty->config_load("test.conf");
Solution:
The load configuration function should be configLoad, instead of config_load.
$smarty = new Smarty ();
$smarty->configLoad("test.conf");
2014年1月20日 星期一
[Small Tips] Useful server variable in PHP
$_SERVER['HTTP_HOST'];
-> returns xxx.com
$_SERVER["REQUEST_URI"];
->returns xxx.php
$_SERVER['REMOTE_ADDR'];
-> returns 192.x.x.x
-> returns xxx.com
$_SERVER["REQUEST_URI"];
->returns xxx.php
$_SERVER['HTTP_REFERER'] -> returns previous page $_SERVER['REMOTE_ADDR'];
-> returns 192.x.x.x
2014年1月18日 星期六
jquery: get sibling
Search from google for the jquery on how to get sibling
You cannot write:
next("a"), because next() only tries to match the very next element. It will hit the<br>element and match nothing.closest("a"), because closest() walks up the ancestor chain, starting with the element itself, and therefore will miss the<a>elements.
You can write:
next().next(), as Arend suggests. That's probably the fastest solution, but it makes the<br>elements mandatory.nextUntil("a").last().next(), which only iterates over the next siblings until it finds a link, then returns the immediate next sibling of the last element matched. It might be faster thannextAll(), again, depending on your markup.Ref: http://stackoverflow.com/questions/6237673/cleanest-way-to-get-a-sibling-in-jquery
2014年1月9日 星期四
Compress your web content in apache DEFLATE, gzip
This article teaches you how to compress your web page in your apache
1.Enable the deflate module
LoadModule deflate_module modules/mod_deflate.so
2. Add the following configuration to httpd.conf
<Location />
# Insert filter
SetOutputFilter DEFLATE
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Don't compress images
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</Location>
3. Restart the apache
httpd -k restart
4. Done
1.Enable the deflate module
LoadModule deflate_module modules/mod_deflate.so
2. Add the following configuration to httpd.conf
<Location />
# Insert filter
SetOutputFilter DEFLATE
# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Don't compress images
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</Location>
3. Restart the apache
httpd -k restart
4. Done
2013年8月24日 星期六
Resolved: Smarty + jquery
Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template ".\templates\common\master.tpl" on line 43 "(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){" - Unexpected "[", expected one of: "}" , " " , ATTR' in D:\xampp\htdocs\smarty\sysplugins\smarty_internal_templatecompilerbase.php:667 Stack trace: #0 D:\xampp\htdocs\smarty\sysplugins\smarty_internal_templateparser.php(3144): Smarty_Internal_TemplateCompilerBase->trigger_template_error() #1 D:\xampp\htdocs\smarty\sysplugins\smarty_internal_templateparser.php(3209): Smarty_Internal_Templateparser->yy_syntax_error(64, '[') #2 D:\xampp\htdocs\smarty\sysplugins\smarty_internal_smartytemplatecompiler.php(105): Smarty_Internal_Templateparser->doParse(64, '[') #3 D:\xampp\htdocs\smarty\sysplugins\smarty_internal_templatecompilerbase.php(206): Smarty_Internal_SmartyTemplateCompiler->doCompile('??<!DOCTYPE HTM...') #4 D:\xampp\htdocs\smarty\sysplugins\smarty_inter inD:\xampp\htdocs\smarty\sysplugins\smarty_internal_templatecompilerbase.php on line 667
Solution
<script>
{literal}
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-40401063-1', 'bbgaga.com');
ga('send', 'pageview');
{/literal}
</script>
Solution
<script>
{literal}
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-40401063-1', 'bbgaga.com');
ga('send', 'pageview');
{/literal}
</script>
訂閱:
文章 (Atom)




