I
I
Ivan Karabadzhak2011-11-27 18:20:19
PHP
Ivan Karabadzhak, 2011-11-27 18:20:19

How to make PHP development easier for a beginner?

The boss said that we urgently need to make statistics from the database on the site for the customer. I'm new to php (I wrote Hello World twice).
I write in Notepad ++ via ftp, upload it to the host and test it. Not a very convenient way. How can development be simplified? I installed NetBeans and Aptana Studio - it took a long time to figure it out.
Recommend something.

Answer the question

In order to leave comments, you need to log in

19 answer(s)
V
ValdikSS, 2011-11-27
@Jakeroid

I recommend using phpstorm as an IDE, it has everything you need and don't need.

S
step307, 2011-11-28
@step307

Well finally tin. A person can only start programming, and here they have already been advised by enterprise development methodologies and a bunch of frameworks, etc.
You know this, if complex calculus is explained to a person in grade 3, then most of the theorems will not have to be proved. Only this approach does not work.
My advice is from simple to complex. Wrote hello world, move on to more complex. To stir up a thread for someone, a simple site. Only by making a few more or less non-trivial sites you will understand why you need frameworks and VCS, then start using them.
You have to go all this way, step on a rake. Understand why it is necessary to separate logic from presentation, why OOP is better than procedures, how to achieve code reuse, etc. etc.
And to dip a person immediately into the wilds of MVC - he can generally only start programming!
Essentially: if the server is so fast, why only ftp? Share the folder on your machine and do not arrange crutches for yourself. If it's not so good, test it locally, as already mentioned (just make sure that the product versions on all machines match)

J
Jazzist, 2011-11-27
@Jazzist

1. Make sure that you are familiar with OIVT
2. Study programming theory, from data types to working methods, algorithms and patterns
3. Hang out for a week here php.su/learnphp and here phpfaq.ru/debug
4. Analyze the code of free CMS
5 Frameworks and IDEs
According to the experience of answering on forums, according to the statistics of questions, on the topics above, the alignment is as follows: 1.
30%
2. 80%
3. 80%
4. 20%
5. 10%
the question is often generated by gaps in the head of the TS on several topics at once.

V
Vladimir Chernyshev, 2011-11-28
@VolCh

First of all, start using a VCS (Version Control System) like Mercurial. Git will work too. :) So that when the server crashes, you don’t have to remember what and where you fixed the last time, but just roll back almost instantly to the latest working version, and then calmly figure it out.
Organize at least a two-stage development system - a developer environment (locally or on a separate server / subdomain) and a production environment where scripts are uploaded after at least some testing - editing files on the production server (or uploading them there without testing at least for the syntax of the main stream) very bad practice.
Refuse to use ftp, and other manual deployment methods, use ssh/scp/rsync and deploy scripts (self-written or, for example, Capistrano). Alternatively, use VCS tools - commit changes to the repository from the working directory, merge them from there with the web directory on the server, the main thing is not to forget to close access from the web to the VCS service files. You can use hooks for the second process, but it's better to control it.
Use at least primitive database migrations, do not change the database structure with "handles" in phpmyadmin, but run sql scripts. Then you can at least restore the sequence of actions that led to the crash. And database backups even before minor schema changes. The same applies to the server settings (it is also better to store them in the VCS).
Modern IDEs allow you to do almost all of this through the GUI, but first, IMHO, it's better to figure out how it works in the console.
All of the above is written on the basis of my own bitter experience.

P
powder96, 2011-11-27
@powder96

> I write in Notepad++ via ftp and upload it to the host and test it. Not a very convenient way.
You can set up a local server, or if you don't want to poke around, install Denver. Then you don’t have to upload via FTP - one step less.
> I'm new to php
Set yourself the task - to make some medium-sized project (a simple CMS, a blog engine, a social network), the main thing is that it would be interesting for you to do it. Write a TODO-list, and gradually implement it. While you are thinking about the architecture of your project, drawing the structure of the database, and just coding, you will learn a lot.

V
Vitaly Zheltyakov, 2011-11-27
@VitaZheltyakov

If you have programming experience, then I strongly advise you to install and configure xdebug profiling. This will save you a lot of debugging time and help you understand how the system works. The rest, I think, you will figure it out along the way.

M
mkoreshkov, 2011-11-28
@mkoreshkov

Denver is in hand. The easiest way and you can immediately feel like a "cool proger";)

Y
YourChief, 2011-11-27
@YourChief

did you know that ftp sends passwords in plain text? that the disk space on the server can be mounted to the local FS, both on nix and Windows?

B
Boris Syomov, 2011-11-27
@kotomyava

Still, install an IDE, for example, the same Netbeans, master it in the minimum amount to begin with:
- Deal with creating a project with sources on a remote server, set up an ftp connection.
- Deal with auto-completion.
This requires a couple of hours of time at most, and will greatly facilitate and speed up the work, saving you from a huge number of unnecessary actions, so this time will pay off very quickly ... =)
Next comes the non-technical moment - you need to start learning PHP systematically, and not just peek into feature guide / google ready-made solutions.
The advice about frameworks is also good. Especially given the large amount of documentation on CI and its quality.
But before that, you still need to deal with PHP itself.

S
segaman, 2011-11-28
@segaman

Look towards Yii Framework`a.
yiiframework.com

S
Sergey, 2011-12-06
@TsarS

Here in vain you wrote that you have experience. It faded immediately. And it was a very interesting topic.

S
soulburner, 2011-11-28
@soulburner

1. set up a local system for testing. apache + php + mysql. do not be afraid, everything is set up simply and there are heaps of manuals. there is also an auto-adjustable kit for all of the above, called “Denver”, but I myself have not used it, I can’t say anything. but they say that it installs all this goodness in 2 clicks
2. use a normal IDE to write PHP. e.g. PHP Designer. it, moreover, automatically configures xdebug, which allows you to run and debug PHP code directly in the IDE.
3. about the frameworks - here you have to be careful. first learn the basics, and not immediately try to fasten the hell knows what

K
krovatti, 2011-11-28
@krovatti

I personally use Netbeans. Relatively recently discovered Microsoft Webmatrix. The second is easier to use, suits your requirements. I advise you to try.

K
krovatti, 2011-11-28
@krovatti

Yes, and in Notepad ++, as far as I remember, you can open a file in a browser and send it using FTP. I can be wrong.

K
krovatti, 2011-11-28
@krovatti

It is assumed that you already have Apache + PHP + MySQL installed on your PC

Z
zoOB, 2011-11-28
@zoOB

I work on Zend Studio 8 (or the free Eclipse PDT), as in NetBeans, you can work via SFTP. If the internet allows that is a great option.

M
markoffko, 2011-11-29
@markoffko

Set up Netbeans/phpstorm on a remote server, work for three minutes, download the sources, edit, save, test. For the first time, it's better. Well, make a backup of the database as often as possible, the chance that you will rub something is extremely high.

G
garfik, 2011-11-29
@garfik

I would recommend the free editor Komodo Edit. It works great with FTP, there is auto-completion, highlighting, tabs \ spaces, encoding, etc., are configured. Really like!
If you have money, then you can also Komodo IDE, as I remember there is also a debugger.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question