0

I have a Azure WebApp + Services written in Yii and Yii 2 respectively. The database is MySQL db from ClearDB. i am hosting it on using the empty Php app.

Reference: https://blogs.msdn.microsoft.com/azureossds/2015/07/23/migrate-yii-framework-application-to-azure-web-app/

The webapp is working fine. In services when trying to connect to the ClearDB MySQL its working fine in XAMPP.

When use the same code in IIS 7 in my local (to simulate azurewebsites) i am receiving: i am getting error 500 (Internal server error) with message: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it. When i placed the same code on azurewebsites: i am getting error 500 (Internal server error) with no message,

Here is my project structure:

 Local: Xampp server
 htdocs/
       myapp/
             dashboard/            ---> this the website folder (Yii)
             modules/
                     v1/           -----> here are my yii2 services and controllers.
praveen seela
  • 538
  • 11
  • 24
  • I tried `Yii::$app->db->open();` both on Azure and IIS on local to test the connection but couldn't reproduce your issue. Could you connect to database via mysql workbench successfully? And you can follow https://azure.microsoft.com/en-us/documentation/articles/web-sites-php-configure/#how-to-change-the-built-in-php-configurations to show error message on Azure – Gary Liu Nov 14 '16 at 09:13
  • I am able to connect from woekbench. here is the error message from dump taken from Kudu. Detailed Error Information: "" Module FastCgiModule Notification ExecuteRequestHandler Handler PHP56_via_FastCGI Error Code 0x00000000 Requested URL http://testleads:80/index.php Physical Path D:\home\site\wwwroot\index.php Logon Method Anonymous Logon User Anonymous"" – praveen seela Nov 14 '16 at 13:45
  • i have checked in my windows xampp, getting the same error as in iis: "status_code": 500, "message": "SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it.\r\n" magically its working in mac + xampp. need to change some settings in windows? any idea? – praveen seela Nov 15 '16 at 05:13
  • Maybe you can try to separate your applications in yii1 & yii2 into two independent applications in two independent Azure Web Apps. – Gary Liu Nov 15 '16 at 05:27
  • two webapps worked Gary. Thanks for the suggestion. anyway to make it a single app? it will help me in cost reduction. – praveen seela Nov 15 '16 at 09:11
  • Have you tried to close db connection each time when you query someting whether in yii1 or yii2. – Gary Liu Nov 16 '16 at 07:45
  • yes. closing the connection is in place in both the apps – praveen seela Nov 16 '16 at 10:54

0 Answers0