executing php files in a angular2cli app

帅比萌擦擦* 提交于 2019-12-24 09:40:19

问题


Creating an angular2 app using angular2cli the php files are not being compiled correctly wondering if the server that comes with angular cli understand php. If not are there any suggestions for angular2cli to understand php


回答1:


Angular-cli runs a server called 'livereload server' (https://github.com/napcs/node-livereload).
When you run "ng serve" you would probably be seeing a message like:

"Livereload server on http: //localhost:49152
Serving on http: //localhost:4200/"

Livereload server runs on top of NodeJS which is used to execute javascript. To execute php files, you will have to run some other server concurrently, eg. Apache. After running the apache server, you will have to load the URL specified in the apache configuration file instead of the one specified by Livereload. Your php files should now get executed properly, the drawback being live reload of your webpage will not be working.

This is the solution I am using and it works perfectly.



来源:https://stackoverflow.com/questions/38465263/executing-php-files-in-a-angular2cli-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!