Yes, it is possible yes. But almost no one does. Generally the gain is not worth the effort, which is much higher.
What is more, if one does not master every process of development, master every minutiae of language, it can have a much worse result. Languages do not perform miracles. They can allow the programmer to get the desired result if he knows what he is doing.
All the programming languages mainstream can be used to develop websites, since what we call websites are text pages. Every language can generate text. These texts need to be used by an HTTP server. Every HTTP server can call an executable and get this text somehow. Of course, if the language can communicate more efficiently with this server, better. There are libraries for C/C++ that help with this. Note that it is common for these HTTP servers to be written in C or C++.
The programming language is not the problem.
Stuck
It is possible that these locks are related to your problem which is quite complex. But it’s also possible that it’s because you’re not using PHP properly. Then changing language will not solve any problem, it may even happen otherwise. PHP is very easy, it is more difficult to do something wrong in it. But I see that many people do. PHP is one of the most used languages to develop websites, do complex things, and does not lock.
I even have criticism of PHP, but almost everything for the web can be developed with it. It will not always be the most suitable language, but in simple things it usually is. Even if it is not the most suitable, it will still be reasonably adequate.
What people often do when they need extreme performance is move to Java or C# which is almost as easy as PHP and with much better performance.
I could suggest a number of things I could do in PHP itself to improve performance, but even that shouldn’t be the problem. It must be something related to the algorithm adopted. So more specific questions about a one-off problem may be helpful in finding what is occurring.
But reinforcement, that if you do not know how to do everything very well, not understand every aspect of computing, you will not get good results in any language. Maybe the way is to improve on that point.
You can do anything with c++, drivers, operating systems, applications. Web applications are no exception. Whether they are more efficient? This is based on opinions
– Bruno Costa
You can develop websites in C/C++ but it will require much more effort than if you use a language more suited to this type of development.
– Haroldo_OK
@Haroldo_ok This is also based on opinions. Similar to other languages, there are also libraries in c++ that facilitate the development of servers, following even for example the MVC pattern
– Bruno Costa
https://github.com/ipkn/crow
– vinibrsl