FabulousCode Blog

Sunday, August 24, 2025

Install IIS (Internet Information Services) For PHP

August 24, 2025 0
 Install IIS (Internet Information Services) For PHP


 Install IIS (Internet Information Services) For PHP



Download Link  IIS Manager


Step 1 — Install IIS (Internet Information Services)

First, we need to enable IIS on your machine.

For Windows 10/11 / Windows Server:

  1. Press Win + R, type:

    appwiz.cpl

    and press Enter.

  2. On the left side, click Turn Windows features on or off.

  3. In the list, find and check:

    • Internet Information Services

    • Expand IISWorld Wide Web ServicesApplication Development Features
      Enable:

      • ASP.NET (Both 3.5 & 4.8 if available)

      • ISAPI Extensions

      • ISAPI Filters

      • CGI

    • Under Web Management Tools, enable IIS Management Console.

  4. Click OK.

  5. Wait until IIS installs.

Check IIS is installed:
Open a browser and go to:

http://localhost

If you see the IIS Welcome Page, IIS is installed successfully.


Step 2 — Download and Install PHP

We'll use the PHP for Windows (Thread Safe) version for IIS.

Steps:

  1. Go to the official PHP website:
    https://windows.php.net/download/

  2. Choose the latest Thread Safe version of PHP (e.g., PHP 8.2 / 8.3).

  3. Download the .zip file (not the installer).

  4. Extract the ZIP file to a folder, e.g.:

    C:\PHP

Step 3 — Install PHP Manager for IIS (Optional but Recommended)

PHP Manager is a tool that makes managing PHP inside IIS much easier.

  1. Download PHP Manager for IIS:
    https://github.com/phpmanager/phpmanager/releases

  2. Run the installer.

  3. After installation, open IIS Manager → You'll see PHP Manager under the IIS section.


Step 4 — Configure PHP in IIS

Option 1: Using PHP Manager (Recommended)

  1. Open IIS Manager.

  2. Click on your server name in the left panel.

  3. Double-click PHP Manager.

  4. Click Register new PHP version.

  5. Browse to:

    C:\PHP\php-cgi.exe
  6. Click OK.


Option 2: Manual Configuration

If you don't want to install PHP Manager, do it manually.

Steps:

  1. Open IIS Manager.

  2. Click on your server name → Double-click Handler Mappings.

  3. Click Add Module Mapping on the right.

  4. Fill in the details:

    • Request Path*.php

    • ModuleFastCgiModule

    • ExecutableC:\PHP\php-cgi.exe

    • NamePHP via FastCGI

  5. Click OK → When prompted, click Yes to create the FastCGI handler.


Step 5 — Configure php.ini

  1. Go to:

    C:\PHP
  2. Copy:

    php.ini-development

    Rename it to:

    php.ini
  3. Open php.ini in Notepad.

  4. Search for:

    ;extension_dir

    Update it:

    extension_dir = "C:\PHP\ext"
  5. Enable required extensions by removing the ; before them. For example:

    extension=mysqli extension=pdo_mysql extension=gd extension=curl
  6. Save the file.


Step 6 — Add PHP to System Environment Variables

  1. Right-click This PCProperties.

  2. Go to Advanced system settings.

  3. Click Environment Variables.

  4. Under System variables, find Path → Click Edit.

  5. Add:

    C:\PHP
  6. Click OK.


Step 7 — Configure IIS Default Document

  1. Open IIS Manager.

  2. Select your website → Double-click Default Document.

  3. Click Add.

  4. Enter:

    index.php
  5. Move index.php to the top of the list.


Step 8 — Test PHP Configuration

  1. Go to your IIS root folder:

    C:\inetpub\wwwroot
  2. Create a file named:

    info.php
  3. Paste the following code:

    <?php phpinfo(); ?>
  4. Open your browser and visit:

    http://localhost/info.php
  5. If you see the PHP Information Page, PHP is successfully configured.


Step 9 — Configure PHP with SQL Server (Optional)

If you want to connect PHP with SQL Server:

  1. Download the SQLSRV drivers from Microsoft:
    https://learn.microsoft.com/en-us/sql/connect/php/download-drivers-php-sql-server

  2. Extract and copy the php_sqlsrv.dll & php_pdo_sqlsrv.dll files into:

    C:\PHP\ext
  3. Open php.ini and enable:

    extension=php_sqlsrv.dll extension=php_pdo_sqlsrv.dll
  4. Restart IIS:

    iisreset

Step 10 — Restart IIS

Wednesday, July 16, 2025

Oracle Sequence তৈরির সঠিক উপায়: টেবিলের সর্বোচ্চ ID থেকে শুরু করা

July 16, 2025 0
Oracle Sequence তৈরির সঠিক উপায়: টেবিলের সর্বোচ্চ ID থেকে শুরু করা

 

Oracle Sequence তৈরির সঠিক উপায়: টেবিলের সর্বোচ্চ ID থেকে শুরু করা

Oracle ডাটাবেসে যখন আমরা কোনো টেবিলে নতুন রেকর্ড যোগ করার সময় ইউনিক আইডি অটো জেনারেট করতে চাই, তখন সাধারণত Sequence ব্যবহার করা হয়। তবে অনেক সময় টেবিলে আগে থেকেই ডাটা থাকায় নতুন সিকোয়েন্স তৈরি করার সময় শুরু করার মানটা হতে হবে টেবিলের সর্বোচ্চ আইডির পরবর্তী সংখ্যা।

এখানে দেখানো হবে কিভাবে PL/SQL ব্লক ব্যবহার করে টেবিলের সর্বোচ্চ SAMPLE_ID বের করে সেই মান থেকে সিকোয়েন্স তৈরি করবেন।


সমস্যা

ধরা যাক, আপনার টেবিলের নাম XXPWC.PWC_OM_TEST_REQUEST_DEPT_SEND এবং এতে একটি কলাম আছে SAMPLE_ID যেখানে ইউনিক আইডি রাখা হয়।
আপনি একটি সিকোয়েন্স তৈরি করতে চান যা সর্বোচ্চ SAMPLE_ID থেকে ১ বাড়িয়ে শুরু হবে।


সমাধান

আমরা নিচের স্টেপগুলো অনুসরণ করব:

  1. টেবিল থেকে MAX(SAMPLE_ID) বের করব

  2. পুরানো সিকোয়েন্স থাকলে সেটি ড্রপ করব

  3. নতুন সিকোয়েন্স তৈরি করব যা MAX(SAMPLE_ID) + 1 থেকে শুরু হবে


PL/SQL ব্লক কোড

plsql

DECLARE v_max_id NUMBER; BEGIN -- ১. টেবিল থেকে সর্বোচ্চ SAMPLE_ID বের করা SELECT NVL(MAX(SAMPLE_ID), 0) INTO v_max_id FROM XXPWC.PWC_OM_TEST_REQUEST_DEPT_SEND; -- ২. যদি পুরানো সিকোয়েন্স থাকে, সেটি ড্রপ করা হবে BEGIN EXECUTE IMMEDIATE 'DROP SEQUENCE SAMPLE_ID_SEQ'; EXCEPTION WHEN OTHERS THEN IF SQLCODE != -2289 THEN -- ORA-02289: sequence does not exist, তখন এড়িয়ে যাব RAISE; END IF; END; -- ৩. নতুন সিকোয়েন্স তৈরি করা হবে সর্বোচ্চ SAMPLE_ID + 1 থেকে শুরু করে EXECUTE IMMEDIATE 'CREATE SEQUENCE SAMPLE_ID_SEQ START WITH ' || (v_max_id + 1) || ' INCREMENT BY 1 NOCACHE NOCYCLE'; DBMS_OUTPUT.PUT_LINE('Sequence SAMPLE_ID_SEQ created starting at ' || (v_max_id + 1)); END; /

কিভাবে ব্যবহার করবেন?

  • উপরের কোডটি Oracle SQL Developer বা আপনার পছন্দের SQL টুলে রান করুন।

  • এটি পুরানো সিকোয়েন্স থাকলে তা ড্রপ করবে এবং নতুন সিকোয়েন্স তৈরি করবে।

  • নতুন সিকোয়েন্স নাম হবে SAMPLE_ID_SEQ এবং এটি সর্বোচ্চ SAMPLE_ID থেকে পরবর্তী মান দিয়ে শুরু হবে।


কেন এটি প্রয়োজন?

  • অনেক সময় ডাটাবেস মাইগ্রেশন বা ম্যানুয়াল ডাটা ইনসার্টের কারণে টেবিলে ইতিমধ্যেই ডাটা থাকে।

  • সিকোয়েন্স যদি সর্বদা 1 থেকে শুরু করে, তাহলে নতুন ইনসার্টে ডুপ্লিকেট কী এরর হবে।

  • তাই MAX(ID) + 1 থেকে সিকোয়েন্স শুরু করা জরুরি।


অতিরিক্ত টিপস

  • যদি Multi-user environment এ concurrency issue থেকে বাঁচতে চান, তাহলে Sequence ব্যবহার করাই সেরা উপায়।

  • সরাসরি MAX(ID)+1 ব্যবহার না করে সিকোয়েন্স দিয়ে অটো ইনক্রিমেন্ট করুন।

  • আপনার ডাটাবেসে সিকোয়েন্স তৈরি ও ড্রপ করার পারমিশন থাকতে হবে।

Friday, July 11, 2025

How to Auto-Fill a Field in Oracle APEX Interactive Grid Based on LOV Selection - By PL/SQL Function

July 11, 2025 0
How to Auto-Fill a Field in Oracle APEX Interactive Grid Based on LOV Selection - By  PL/SQL Function

 



✅ লক্ষ্য:

  • TEST_CODE একটি LOV ফিল্ড

  • TEST_DESCRIPTION একটি Display-Only ফিল্ড

  • TEST_CODE নির্বাচন করলে TEST_DESCRIPTION অটোফিল হবে

  • Backend query ব্যবহার করে description fetch হবে


🔷 Step-by-Step Guide


🟠 Step 1: Create a PL/SQL Function

Oracle DB তে নিচের function টি তৈরি করুন:

plsql
CREATE OR REPLACE FUNCTION get_item_description ( p_inventory_item_id IN NUMBER ) RETURN VARCHAR2 IS l_description VARCHAR2(1000); BEGIN SELECT description INTO l_description FROM ( SELECT msib.inventory_item_id, msib.description FROM mtl_system_items_b msib JOIN mtl_item_catalog_groups micg ON micg.item_catalog_group_id = msib.item_catalog_group_id WHERE micg.description = 'Textile Testing Service (TTSL)' AND msib.organization_id = xxpwc.pwc_organization_name('Item Master Organization') ) WHERE inventory_item_id = p_inventory_item_id; RETURN l_description; EXCEPTION WHEN NO_DATA_FOUND THEN RETURN NULL; END;

🟠 Step 2: Go to APEX Page → Select Interactive Grid

  1. Go to Page Designer

  2. Click on your Interactive Grid (IG) region


🟠 Step 3: Configure TEST_CODE Column

  1. Select TEST_CODE column

  2. Type: Select List

  3. List of Values:

    sql
    SELECT msib.segment1 || ' - ' || msib.description AS display_value, msib.inventory_item_id AS return_value FROM mtl_system_items_b msib JOIN mtl_item_catalog_groups micg ON micg.item_catalog_group_id = msib.item_catalog_group_id WHERE micg.description = 'Textile Testing Service (TTSL)' AND msib.organization_id = xxpwc.pwc_organization_name('Item Master Organization') ORDER BY msib.segment1

🟠 Step 4: Create Dynamic Action

  1. Select the Interactive Grid region

  2. In the right pane, go to Dynamic Actions

  3. Click Create → Choose:

    • Event: Change

    • Selection Type: Column

    • Column: TEST_CODE

  4. Name the DA: Set Test Description


🟠 Step 5: Add True Action → PL/SQL Code

  1. Under the Dynamic Action, add a True Action

  2. Action Type: Execute PL/SQL Code

  3. Code:

plsql

:P_TEST_DESCRIPTION := get_item_description(:P_TEST_CODE);

⚠️ Replace :P_TEST_CODE with the selected value of TEST_CODE column. Since this is Interactive Grid, we need to use Row context.

  1. In Items to Submit: add the column TEST_CODE

  2. In Page Items to Return: add the column TEST_DESCRIPTION


🟠 Step 6: Assign Returned Value to TEST_DESCRIPTION

Still under the same Dynamic Action:

  1. Add another True Action → Choose Set Value

  2. Set type to: PL/SQL Function Body

  3. Code:

plsql

return get_item_description(:TEST_CODE);
  1. Set Affected ElementsSelection Type: ColumnColumn: TEST_DESCRIPTION


🟠 Step 7: Set TEST_DESCRIPTION Column

  1. Select TEST_DESCRIPTION column in grid

  2. Type: Display Only

  3. Optionally set Read-Only, Escape special characters = Off


✅ Done! Test It:

  • Run the page

  • Select a value in TEST_CODE

  • TEST_DESCRIPTION will auto-populate using your function

How to Auto-Fill a Field in Oracle APEX Interactive Grid Based on LOV Selection - By PL/SQL Query

July 11, 2025 0
How to Auto-Fill a Field in Oracle APEX Interactive Grid Based on LOV Selection - By PL/SQL Query




Oracle APEX Interactive Grid এ LOV থেকে অন্য কলাম অটোমেটিক ফিল্ড সেট করার সহজ পদ্ধতি

Oracle APEX এ Interactive Grid খুবই শক্তিশালী টুল যেখানে আপনি ডেটা এন্ট্রি ও ডাটাবেজ অপারেশন করতে পারেন। অনেক সময়ই প্রয়োজন হয়, কোনো একটি LOV (List of Values) থেকে সিলেকশন করার পর অন্য কলামটি অটোমেটিক সেই সিলেক্টেড আইটেমের ডিটেইলস দিয়ে পূরণ করতে।

এই ব্লগে আমি আপনাদের দেখাবো কিভাবে PL/SQL এবং Dynamic Action ব্যবহার করে TEST_CODE1 নামে একটি LOV থেকে সিলেক্ট করলে TEST_DESCRIPTION কলামে সেই আইটেমের ডিসক্রিপশন অটোমেটিক ভরা যাবে।


প্রয়োজনীয় পদক্ষেপ গুলো


Step 1: TEST_CODE1 কলামে LOV কনফিগারেশন করা

  1. Oracle APEX এর Page Designer এ যান।

  2. আপনার Interactive Grid রিজিয়ন খুলুন।

  3. TEST_CODE1 কলাম সিলেক্ট করুন।

  4. কলামের জন্য Type হিসেবে Select List সেট করুন।

  5. List of Values অংশে নিচের SQL কোড দিন:

sql
SELECT msib.segment1 || ' - ' || msib.description AS display_value, msib.inventory_item_id AS return_value FROM mtl_system_items_b msib JOIN mtl_item_catalog_groups micg ON micg.item_catalog_group_id = msib.item_catalog_group_id WHERE micg.description = 'Textile Testing Service (TTSL)' AND msib.organization_id = xxpwc.pwc_organization_name('Item Master Organization') ORDER BY msib.segment1
  1. Required অংশে Save Session State চালু রাখুন।


Step 2: TEST_DESCRIPTION কলাম কনফিগার করা

  1. TEST_DESCRIPTION কলামটি সিলেক্ট করুন।

  2. এর Type হিসেবে Text Field অথবা Display Only দিন।

  3. প্রয়োজন হলে Read Only সেট করুন যাতে ব্যবহারকারী এটি পরিবর্তন করতে না পারে।


Step 3: Dynamic Action তৈরি করা

  1. Page Designer এর বাম পাশে Dynamic Actions সেকশনে যান।

  2. আপনার Interactive Grid এর উপর রাইট ক্লিক করে Create Dynamic Action সিলেক্ট করুন।

  3. নিচের মতো Dynamic Action সেট করুন:

PropertyValue
NameAuto Fill Description
EventChange
Selection TypeColumn
ColumnTEST_CODE1

Step 4: True Action হিসেবে Set Value কনফিগার করা

  1. Dynamic Action এর নিচে True অংশে ক্লিক করুন।

  2. Action হিসেবে Set Value নির্বাচন করুন।

  3. নিচের সেটিংস দিন:

PropertyValue
Set TypePL/SQL Function Body
Items to SubmitTEST_CODE1
Affected ElementsColumn → TEST_DESCRIPTION
  1. PL/SQL Function Body হিসেবে নিচের কোড দিন:

plsql
DECLARE l_desc VARCHAR2(1000); BEGIN SELECT msib.description INTO l_desc FROM mtl_system_items_b msib JOIN mtl_item_catalog_groups micg ON micg.item_catalog_group_id = msib.item_catalog_group_id WHERE micg.description = 'Textile Testing Service (TTSL)' AND msib.organization_id = xxpwc.pwc_organization_name('Item Master Organization') AND msib.inventory_item_id = :TEST_CODE1; RETURN l_desc; EXCEPTION WHEN NO_DATA_FOUND THEN RETURN NULL; END;

Step 5: সেভ করে অ্যাপ রান করুন

  1. সব পরিবর্তন সেভ করুন।

  2. অ্যাপ্লিকেশন রান করুন।

  3. Interactive Grid এর TEST_CODE1 থেকে আইটেম সিলেক্ট করুন।

  4. দেখবেন TEST_DESCRIPTION কলামে সেই আইটেমের ডিসক্রিপশন স্বয়ংক্রিয়ভাবে সেট হয়ে গেছে।