This article will guide you on how to open and edit PHP programming files on both Windows and Mac computers.
Steps
On Windows

Download and install Notepad++. This is a free text editor for Windows that lets you open PHP files. To install this program, follow these steps:
- Go to https://notepad-plus-plus.org/download/v7.5.8.html from your browser.
- Click the green DOWNLOAD button.
- Double-click the Notepad++ setup file.
- Follow the installation instructions.



Click on the File (File). This option is located in the top-left corner of the Notepad++ window. A list of options will appear here.

Nhấp vào Open… (Mở). Đây là một lựa chọn trong trình đơn đang hiển thị. Bạn sẽ thấy cửa sổ File Explorer xuất hiện trên màn hình.

Chọn tập tin PHP. Hãy nhấp vào thư mục lưu tập tin PHP, rồi nhấp vào tập tin PHP đó để chọn.

Nhấp vào Open. Đây là lựa chọn ở bên dưới góc phải cửa sổ. Thao tác này sẽ mở tập tin PHP trong Notepad++, cho phép bạn xem mã lệnh của tập tin và thực hiện các chỉnh sửa cần thiết.
- Nếu bạn đã chỉnh sửa tập tin PHP, hãy ấn Ctrl+S để lưu các thay đổi trước khi thoát Notepad++.
Trên Mac

Tải và cài đặt BBEdit. Đây là chương trình miễn phí cho phép bạn xem và chỉnh sửa rất nhiều loại tập tin, bao gồm cả PHP. Hãy thực hiện các bước sau để cài đặt chương trình này:
- Truy cập https://www.barebones.com/products/bbedit/ bằng trình duyệt web của máy Mac.
- Nhấp vào Free Download (Tải về miễn phí) ở phía trên góc phải trang.
- Nhấp đúp vào tập tin DMG đã tải về.
- Xác minh phần mềm nếu được yêu cầu.
- Kéo biểu tượng BBEdit vào thư mục "Applications" (Ứng dụng).
- Thực hiện theo hướng dẫn trên màn hình.



Open BBEdit. Type bbedit, then double-click on BBEdit in the list of search results.
- If this is your first time opening BBEdit after installation, click Open when prompted, then click Continue to start the 30-day trial.

Click on the File (File). This option is located in the top-left corner of the screen. A list of choices will appear here.

Click on Open… (Open). This option is found in the File menu. The Finder window will open after this action.

Select the PHP file. Navigate to the folder containing the PHP file, then click on the file to select it.

Click on Open. This option is located at the bottom-right corner of the window. Clicking this will open the PHP file in BBEdit, allowing you to view its contents.
- You can also click Choose here.
- If you have edited the PHP file, remember to save it by pressing ⌘ Command+S.
Advice
- Dragging and dropping a PHP file into a web browser (including Firefox) will open the PHP code. The file may not display correctly, but at least you can view its code.
Warning
- Always save a backup of the original PHP file before making any changes. Incorrectly editing the code may cause your website to stop functioning; it’s safer to create a duplicate first.