Abdulwasa
Abdulwasa

Reputation: 25

How to integrate and run php in existing vue app in the same local host?

I have build an app with vue (not with vue cli). I ran It on my local host. What I am trying to do is to add php in this Project. But I cannot run php and vue on the same local host together. Is there a way to solve this problem ?

I know when the app is created with command line interface you can compile them with webpack. But how to combine back-end and front-end together when the app is created with vue?

Thanks a lot in advance

Upvotes: 2

Views: 3141

Answers (1)

Sayed Mohd Ali
Sayed Mohd Ali

Reputation: 2254

Vue is a javascript framework and I suppose you are familiar with javascript. In javascript, we use AJAX to interact with PHP. we used to send POST and GET request to the server via ajax and javascript and we get the response from the server.

In a similar way, you need to learn how to create Rest API for GET and POST via vueJS and PHP.

You Need to create Rest API for VueJS and PHP. There is no other solution. follow the links below as per your need.

  1. Here is the Github Link for the Same

  2. You can also use Laravel framework with Vue

Upvotes: 2

Related Questions