Pages

Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Friday, December 6, 2013

HTTP Basic Auth with PHP in CGI-mode

phpinfo();
Server APICGI/FastCGI

https://github.com/symfony/symfony/issues/1813

add  to .htaccess file ( in root dir )following :
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
</IfModule>

in php script: 

list($SERVER['PHPAUTH_USER'], $SERVER['PHPAUTH_PW']) = explode(':' , base64_decode(substr($SERVER['HTTPAUTHORIZATION'], 6)));

Thursday, April 25, 2013

[ Joomla ] You have an error in your SQL syntax, check the manual that corresponds to your MySQL server version for the right syntax to use near .....

Khi install joomla ( 1.5.22 ) gặp bug sau :

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near .....


- Problem ?
The keyword ‘TYPE’ was introduced as deprecated since ENGINE was added in MySQL 4.0.18.
in the CREATE TABLE structure manaul page (http://dev.mysql.com/doc/refman/4.1/en/create-table.html) that the TYPE keyword will be removed in future versions.

Do vậy khi install joomla trên mysql v 5.x sẽ có bug này. tham khảo create command được run khi install joomla.
CREATE TABLE `#__bannertrack` (
`track_date` date NOT NULL,
`track_type` int(10) unsigned NOT NULL,
`banner_id` int(10) unsigned NOT NULL
) TYPE=MyISAM CHARACTER SET `utf8`;
- Giải quyết :tham khảo http://www.devraju.com/programming/joomla-1-5-22-installation-sql-problem-typemyisam-solution-enginemyisam/
==> Tóm tắt : tìm Joomlafolder/installation/sql/mysql/joomla.sql và replace all : ‘TYPE=MyISAM’ to ‘ENGINE=MyISAM’