I have a problem with the netbeans7.3.1 when ever I try to run my php program i get this error from the browser : Unable to connect
Firefox can't establish a connection to the server at localhost:8000.
my interpreter location is : /usr/bin/php5
The project configuration : PHP Built-in Web Server (running on built- in web server)
my operating system is : Ubuntu linux.
I've been having this problem for more then 6 months now, I've looked and searched everywhere but I could not find the solution for this.
Just to mention that I had another problem with the interpreter it used to ask me to locate the interpreter every time i run netbeans , but i fixed this by installing php5.
Related
I am new to PHP and Laravel.
I installed Laravel and Composer , created new project and it is working fine.
Now when i tried to migrate a database using this command php artisan migrate i got errors, i wonder is it something related to not installing Xampp ? i am running Mac OS
The errors i got is
1 PDOException::("SQLSTATE[HY000] [2002] Connection refused")
/app/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68
2 PDO::__construct("mysql:host=127.0.0.1;port=3306;dbname=app", "root", "", [])
/app/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68
Xampp has nothing to do with Laravel itself. Xampp is a set of tools that is usually used together to deliver websites. Xampp just makes it easier (supposedly) to install those set for you. Rather than having to install and setup all yourself.
Today people tend to avoid such sets in favour for tools like Vagrant or Docker.
Laravel even provides its own Vagrant setup called Homestead.
See ie. in Laravel 5.5 docs: https://laravel.com/docs/5.5/homestead
If you don't want to use Homestead but build your own server environment there's also tools to make this easier for you.
For example there is http://www.puphpet.com for PHP + Vagrant and https://phpdocker.io/ for PHP + Docker.
Xampp is not required but a php server like apache or nginx is required also in order to use mysql you should have mysql installed you get this error
PDOException::("SQLSTATE[HY000] [2002] Connection refused")
/app/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:68
because the mysql service is turned off so I think you open Xampp control Panel and you start mysql in order for it to work and this is why you have asked if Xampp is required am I right !!!
Actually to prove that Xampp has nothing to do with Laravel you can start the mysql server from command line I will give you example in windows OS.
if you have xampp installed on C:/ Driver lets say then try cd(change directory) into this path in your command line
cd c:/xampp/mysql/bin
start mysqld.exe // this will start the mysql service for you
now you can navigate to your Laravel app and try to migrate this time you won't get connection refused error and that is because you have started the Mysql server from command line.
I think this proves that Xampp has nothing to do with Laravel.
Hope this was helpful, good luck.
Mac OS comes with PHP built into it. You should be able to use php -v to see what version. Use php -S localhost:xxxx to output the local directory to a local address.
For example, to run laravel locally, open the terminal cmd+spacebar, type terminal, open it, then use change to the path where your laravel project is.
Type php -S localhost:3000 and it should give you a confirmation in the terminal. Now open a browser and go to localhost:3000 and it should show your project.
I was using Netbeans IDE 8.0.2 on Windows 8.1 to develop my PHP applications. There was no issue with it. But later on when I start using Netbeans (same version) on windows 7, Although the ftp connection was successful but it was giving error:
Error while listing files /.
After too many searches I found that by disabling features at firewall the problem is solved, All you have to do is just run a simple command in cmd.
Run cmd in administrative mode
Paste following command
netsh advfirewall set global StatefulFTP disable
Now you are almost done!
Goto Netbeans->New Project->PHP->PHP Application from remote server
Follow other instructions and you are done! (Note sometimes you will need to do that with passive mode)
I'm building a website with PHP and using MySQL as the database, so I need help setting up the development environment. I want to execute and test the PHP scripts locally, with all the local database connections and all the operations possible on database by PHP scripts.
I'm on Windows and I've installed MySQL and Eclipse IDE for PHP, so how do I connect these two applications, so that the scripts related to database can directly execute queries on this MySQL installation? Also the Eclipse IDE isn't able to execute the scripts on localhost, it returns this error "The webpage cannot be found".
So how can this be solved and connections be made to MySQL?
Are you able to connect your website to the database? What server are you using? WAMP or XAMPP? You need to first install the server. You can install wamp from here http://www.wampserver.com/en/.
This would be your starting point.
I want to run my first php project in eclipse(with help of pet package). When I run my project (index.php) eclipse show an error with below message :
Page Login failed with error. Could not connect to the server.
More information :
When I enter "http ://localhost" in my browser it couldn't find server
I'm using kepler version of eclipse
I'm run eclipse in MAC OSX
I think my local server didn't start or I haven't local server. How can I solve this error? How can run local php server in mac ?
Best Regards
You need to install a server package, something like MAMP. Then you need to configure it in order to be driven by Eclipse, using Xdebug, which is a module for Apache. In order to set up your configuration with Xdebug, take a look here: http://wiki.eclipse.org/Debugging_using_XDebug
I installed a plugin for NB 7.0.1 which enabled CodeIgniter but when I went to create a project using it, I was told I need to specify a PHP interpreter for Netbeans. I tried to do this using the php.exe you get with Xampp but I get a Java null pointer error. I can't seem to fix this but I'm thinking, why do I need an interpreter on Windows when the Linux machine can do that? I have already set this up on the VM.
Any advice from here? Thanks a lot!
I am using NB 7.1.1 and had similar issue with CodeIgniter plugin when creating a new project. NetBeans would complain No PHP Interpreter was defined in Tools->Options->PHP General. It would not enable finish button so a New Project could not be setup.
I just created a dummy batch file called nb_cli.bat and pointed NB to that for the PHP interpreter. I don't plan on executing (or debugging) CodeIgniter CLI code on local machine so that file will likely never get executed.
If you want to debug or run php locally, make sure xammp works OK outside of NetBeans. But if not, this fix should get you by the NetBeans issues.
I have a separate linux server on my local network for development as I don't need apache/php locally when I use multiple machines for dev/testing/etc.
NetBeans should bugfix that by downing that PHP Interpreter message from an Alert preventing project setup to a warning that No PHP interpreter is defined (or found) so CLI testing may not function.
As an alternative, if you have a linux box with NB installed, you can create the New project there and copy the whole folder (including the nbproject folder) to your PC and you should be able to get by having No PHP Interpreter defined.
Hopefully that gets you going with NB and CodeIgniter. If you need additional details, just ask.