IoT is the technology that aids the interconnection of all kinds of devices over the internet to replace data, monitor devices and enhance actuators to create outcomes. Cyber-physical systems (CPS) contain control and computation components, which are compactly assured with physical procedures. The internet plays a prominent role in modern lives, and the cybersecurity challenge caused by phishing attacks is significant. This research presents a novel approach to address this problem using machine learning (ML) methods for phishing website classification. Leveraging feature extraction and innovative algorithms, the projected method aims to distinguish between malicious and legitimate websites by features of phishing attempts and analyzing inherent patterns. Phishing is a significant threat that causes extensive financial losses for internet users yearly. This fraudulent act includes identity hackers utilizing clever approaches to deceive individuals into revealing sensitive data. Generally, phishers use strategies such as advanced phishing software and fake emails to illegally acquire confidential details like usernames and passwords from financial accounts. This article develops an Explainable Artificial Intelligence with Aquila Optimization Algorithm in Web Phishing Classification (XAIAOA-WPC) approach on secure Cyber-Physical Systems. The developed XAIAOA-WPC approach mainly emphasizes the effectual classification and recognition of web phishing based on CPS. In the first phase, preprocessing is carried out on three levels: data cleaning, text preprocessing, and standardization. Furthermore, the Harris' Hawks optimization-based feature selection (HHO-FS) method is applied to derive feature subsets. The XAIAOA-WPC method utilizes a multi-head attention-based long short-term memory (MHA-LSTM) model for web phishing recognition. Besides, the detection outcomes of the MHA-LSTM approach are enhanced by using the Aquila optimization algorithm (AOA) model. At last, the XAIAOA-WPC method incorporates the XAI model LIME for superior perception and explainability of the black-box process for precise identification of intrusions. The simulation outcome of the XAIAOA-WPC method is examined on a benchmark database. The experimental validation of the XAIAOA-WPC method exhibited a superior accuracy value of 99.29 % over existing techniques.