Thứ Hai, 21 tháng 11, 2016

[OpenSource] Error Report _ Display Error NukeViet

Hiển thị chi tiết lỗi khi bị các lỗi liên quan đến PHP.

Trong quá trình lập trình thao tác với CSDL, nếu có lỗi, hệ thống sẽ không hiển thị thông báo lỗi mà hiển thị nền trang trắng.
Hướng dẫn dưới đây giúp hiển thị thông báo lỗi của php, khi có sự cố xảy ra.


Mở includes/mainfile.php
Tìm và xóa (hoặc comment) những đoạn code

  error_reporting(0);
 
và....

$ErrorHandler = new NukeViet\Core\Error($global_config);
set_error_handler(array(
    &$ErrorHandler,
    'error_handler'
));
 
 
 
***NukeViet 3.0, file mainfile.php home directory

Comment 2 dong
$ErrorHandler = new Error( $global_config );
set_error_handler( array( &$ErrorHandler, 'error_handler' ) );

Thứ Tư, 9 tháng 11, 2016

[ASP.NET] MVC 2 Error : The type or namespace name 'Mvc' does not exist in the namespace 'System.Web'

lỗi :
Compiler Error Message: CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

Source Error:

Line 57: <add namespace="System.Web.Mvc" />
Line 58: <add namespace="System.Web.Mvc.Ajax" />
Line 59: <add namespace="System.Web.Mvc.Html" />
Line 60: <add namespace="System.Web.Routing" />
Line 61: <add namespace="System.Linq" />


Web đang chạy trên server cũ khi move qua server mới thì bị lỗi mặc dù cả 2 server đều setup đầy đủ MVC giống nhau. Nguyên do là server mới update bản vá security của window nên path của 1 số assemble thay đổi, code website khi build không set reference copy local=true thì 1 số trường hợp sẽ lỗi.

cách fix là thêm khai báo assembly trong web.config của site

<assemblies>
<add assembly="System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
 </assemblies>
...
</system.web>

[PLESK] Plesk 12 Microsoft FTP Service : 530 User cannot log in, home directory inaccessible.

Cho repair : %plesk_cli%\plesk repair ftp -y
https://kb.plesk.com/en/549 

Kiểm tra computer name khớp với user security

[SSL] Hướng dẫn chung, tổng hợp link


- SSL Renew phải sinh lại CSR : vì cert cấp có thời hạn expired, cần xin cert mới

 
link quản lý đơn hàng của hãng GeoTrust và RapidSSL

Hướng dẫn sinh CSR RapidSSL

[LiteSpeed][Cpanel] Các lỗi thường gặp khi switch to LiteSpeed như 500, 503


LightSpeed Hosting Cpanel
Các lỗi thường gặp khi switch to LiteSpeed như 500, 503 thường là do

1, .htaccess, cấu hình rule trong này ko chuẩn
2, suhosin, modsecurity,
3, xung đột giữa các loại cache như apc cache, Opcache, Memcached, accelerator…

Nếu ko phải 3 nguyên nhân trên thì cần debug step by step theo wiki của LiteSpeed

[LiteSpeed] DirectAdmin website báo 404 notfound


- Buil lại apache trên directadmin
- Kiểm tra file cấu /usr/local/lsws/conf/httpd_config.xml
<user>apache</user>
<group>apache</group>