Corry
user 17190121
Riverview, FL
Post #: 3
After installing NetBeans 7.2, it seems that to get full function out of it I am supposed to have an apache/php/mysql server running on my local system. Am I understanding that correctly, or am I missing some way to simplify.

If I do set up a server on my local system, I would supposed I'd need to carefully duplicate my production server's settings on my local server, Is that also correct?

My server is CentOS and my local machine is Win7.
How will I deal with path issues for situations that require file system path like "/home/user/public_html/whateverfil­e.php" that would, I guess, be "c:\path\to\webroot\whateverfile.ph­p" on my local machine.
Sam L.
samuelelliot
Group Organizer
Saint Petersburg, FL
Post #: 33
Corry,

Full functionality out of NetBeans is arbitrary, completely dependent on you desired outcome. If you are developing a php component, then you wouldn't benefit from MySQL or Apache; however if you are building a web application and you need to see completed pages in HTML, then you may want to test locally. NetBeans can be configured with the path to the PHP executable, this allows you to run the code and even step threw in debug mode. Depending on how you set up you project, you can work on files from a remote server (ftp) and on save the file is updated on the server. NetBeans has been crazy complex at times, and configuring sometimes threw me for a loop.

If you are planning on setting up a local xAMP, creating your environment is important. Though making sure that your development and production systems are comparable is a good idea to an extent, you will want to have certain configurations different. For example, on a production system you may want to send emails, however during development it's advantageous not to allow emails to hit the internet. The primary concern should be version and module concurrency of PHP and MySQL, Apache hasn't changed to drastically, you shouldn't have any problems duplicating it's setup.

For platform agnostic design, paths tend to be the thorn in many fingers. After playing around with code that runs on both Windows and *nix systems, one thing you remember is *nix systems tend to be easier to work with. However, this situation shows that Windows can play ball too. On a Windows system you can specify a path with the Windows or *nix directory separator, just remember that drive letters aren't necessary, direct (full) path specification isn't required under most circumstances, and indirect (relative) paths are the discreet agnostic method for referencing files.

Example (indirect and direct path):

include('../core/bootloader.php');

# OR

include(__DIR__.'../core/bootloader.php'­);

The sign of a problem is when you have hard coded full paths in your application, outside of a single configuration file. If you must have a full path, store the applications root directory in a constant, this allows you to specify full path in reference to the applications current root; regardless of the systems setup. I typically will have a bootloader file which is included (as seen above) define my application constants, this is a good practice.

I hope this helps. :)
Powered by mvnForum

Our Sponsors

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy