I am unable to run php file

i added php file with angular app but unable to access php file

@gyanlok, please fill out the new topic template.

What is your URL

What is the problem

What did you try

Anything else that is relevant.

http://gyanloknews.in/restAPi/connection.php

not working

Again, Please follow the topic template. (Also, you need help, so please use the “Hosting Support” category next time)

What is your URL

http://gyanloknews.in/restAPi/connection.php
What is the problem

What did you try

Anything else that is relevant.

Based on the URL you provided, I can show this topic and say that RestAPI cannot be used on Free Hosting.

http://gyanloknews.in/restAPi/connection.php

not working

then how to we interact with mysql

Again, if you would explain better, we can help you better
** What are you trying to do? **

Actually i want to establish connection with connection.php to mysql
but while runing above mentioned file
hws link is http://gyanloknews.in/restAPi/connection.php

and code is for example

<?php 
    class Database {
        private $host = "XXXXXXX";
        private $database_name = "XXXXX";
        private $username = "XXXXX";
        private $password = "XXXX";

        $conn = new mysqli($host, $username, $password, $database_name);

        if ($conn->connect_error) {
             die("Connection failed: " . $conn->connect_error);
       }else {

            echo "New record created successfully";
       }
                    
?>

But while running the above mentioned file… what? What happens when you try to run that script.

I get a 404 error on http://gyanloknews.in/restAPi/connection.php. So please check the file and directory names are correct (and note that those names are case sensitive on most web hosting servers, including ours).

3 Likes

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.