Try "/api.php"
It wants an URL, not a path.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi, I'm trying to work with PHP in VUE... But I'm getting stuck in here...
this.$http.get('../api/api.php', {params: {pagination: this.pagination}})
.then(response => {
this.$set('items', response.data)
this.$set('pagination', response.data.pagination)
console.log(items)
})
.catch(e => {
// this.errors.push(e)
console.log(e)
})
Only returns: 404 (Not Found)
Already changed to .src/api/api.php, src/api/api.php ... for everything that you can imagine and nothing, only 404. If I use XAMPP to host api.php and use http://localhost/api.php I get error because -> Access-Control-Allow-Origin
Please, any solutions? I was using json api before, but when I build and upload to a hosting service (not node) I cant post on json.
Please or to participate in this conversation.