NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

PHP and MySQL

 
Post new topic   Reply to topic    NetBeans Forums -> PHP Users
View previous topic :: View next topic  
Author Message
liamfitz



Joined: 22 Nov 2016
Posts: 10

PostPosted: Fri Nov 25, 2016 9:13 pm    Post subject: PHP and MySQL Reply with quote

I've used the suggested connection parameters and commands as follows from web-site ( I'm on Apple iMac OS )
Code:
$link = mysqli_init();
        $host = '127.0.0.1';
        $user = 'root';
        $password = 'root';
        $database = 'inventory';
        $port = 3306;
        $socket = 'localhost:/Applications/MAMP/tmp/mysql/mysql.sock';
       
        $success = mysqli_real_connect($link, $host, $user, $password, $database, $port, $socket);
if(mysqli_ping($success))
        {
            echo 'MySQL Server '.mysqli_get_server_info($success).' on '.mysqli_get_host_info($success);
        }

It's not opening a webpage, and doesn't seem to be working. Any help or ideas, would be appreciated. Thanks.
Back to top
paolosca



Joined: 09 Sep 2010
Posts: 513

PostPosted: Mon Nov 28, 2016 1:27 am    Post subject: PHP and MySQL Reply with quote

Can you increase the error level in your php configuration and post the errors you see on screen?

Regards,


Paolo


On Sat, Nov 26, 2016 at 5:13 AM, liamfitz <address-removed ([email]address-removed[/email])> wrote:
Quote:
I've used the suggested connection parameters and commands as follows from web-site ( I'm on Apple iMac OS )

Code:
$link = mysqli_init();
        $host = '127.0.0.1';
        $user = 'root';
        $password = 'root';
        $database = 'inventory';
        $port = 3306;
        $socket = 'localhost:/Applications/MAMP/tmp/mysql/mysql.sock';

        $success = mysqli_real_connect($link, $host, $user, $password, $database, $port, $socket);
if(mysqli_ping($success))
        {
            echo 'MySQL Server '.mysqli_get_server_info($success).' on '.mysqli_get_host_info($success);
        }



It's not opening a webpage, and doesn't seem to be working. Any help or ideas, would be appreciated. Thanks.




Back to top
liamfitz



Joined: 22 Nov 2016
Posts: 10

PostPosted: Mon Nov 28, 2016 9:35 pm    Post subject: Reply with quote

The error on web-page is as follows :

Not Found

The requested URL /PhpTest/index.php was not found on this server.
Back to top
liamfitz



Joined: 22 Nov 2016
Posts: 10

PostPosted: Mon Nov 28, 2016 9:39 pm    Post subject: Reply with quote

The error on web-page is as follows :

Not Found

The requested URL /PhpTest/index.php was not found on this server.
Back to top
paolosca



Joined: 09 Sep 2010
Posts: 513

PostPosted: Tue Nov 29, 2016 9:39 am    Post subject: PHP and MySQL Reply with quote

That's pretty much self explanatory, the browser requested a page that doesn't exist.

You should check the configuration of your web server to make sure the www root corresponds to the project's directory.


If you have a standard apache2 setup on linux you can recreate your project inside the wwwroot directory, usually /var/www/.


I personally prefer work directly inside /var/www as it makes it a lot easier to test my projects.


In alternative you can create a new site configuration with the path to your folder (i.e. /home/user/NetBeansProjects/PhpTest/, but you may encounter permission problems as the user's home directory is usually not accessible by the apache server user.


Regards,


Paolo.




On Tue, Nov 29, 2016 at 5:39 AM, liamfitz <address-removed ([email]address-removed[/email])> wrote:
Quote:
The error on web-page is as follows :

Not Found

The requested URL /PhpTest/index.php was not found on this server.






Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> PHP Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo