TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Absolute Beginners (http://www.talkphp.com/absolute-beginners/)
-   -   Compiling PHP? (http://www.talkphp.com/absolute-beginners/1806-compiling-php.html)

Aaron 12-27-2007 09:06 PM

Compiling PHP?
 
What exactly is compiling PHP?

I cant find anything on google.

obolus 12-27-2007 09:45 PM

Dunno if this helps. This is a dictionary term, that leans more in the direction of desktop programming.

Quote:

To transform a program written in a high-level programming language from source code into object code. Programmers write programs in a form called source code. Source code must go through several steps before it becomes an executable program. The first step is to pass the source code through a compiler, which translates the high-level language instructions into object code.

The final step in producing an executable program -- after the compiler has produced object code -- is to pass the object code through a linker. The linker combines modules and gives real values to all symbolic addresses, thereby producing machine code.

sjaq 12-27-2007 09:52 PM

Compiling PHP is the way you install it on your computer..

Dr John 12-27-2007 11:06 PM

You write your source code. You upload it to your server. It runs. That's it.

It's not like C where you write source code, then compile to create a standalone executable, then run that.

Village Idiot 12-27-2007 11:07 PM

Quote:

Originally Posted by Dr John (Post 7222)
You write your source code. You upload it to your server. It runs. That's it.

Not true, the server compiles it to a binary then runs it. It has to, the processor does not understand PHP.

Salathe 12-27-2007 11:34 PM

Generally when one speaks of compiling PHP, the context is in terms of taking the source code for PHP itself ("Complete Source Code" on the PHP download page) and running a series of programs from the command line to create the PHP executable. That process of going from raw source code into an executable/binary program is compilation. The compiled program (php on linux/unix, php.exe on windows) is what interprets/runs all of our PHP code.

Are you looking to compile PHP yourself, or just looking to see what it's about because you didn't understand the meaning?

Dr John 12-28-2007 12:34 AM

Quote:

Originally Posted by Village Idiot (Post 7223)
Not true, the server compiles it to a binary then runs it. It has to, the processor does not understand PHP.

So as I said you write it, up load it to the server and it runs.
Because YOU don't compile it. The server does so, but only when requested to run it. A separate compiled version doesn't exist (except in memory), unlike with C. Glad we agree on that.

Aaron 12-28-2007 05:53 AM

Oh, that is a very good thing O.o

The first language I learned (or tried to learn) was CPP, and I stopped trying because Dev-CPP didn't work for me, and it was the only free compiler that I knew of.

Village Idiot 12-29-2007 06:19 AM

Quote:

Originally Posted by Aaron (Post 7230)
Oh, that is a very good thing O.o

The first language I learned (or tried to learn) was CPP, and I stopped trying because Dev-CPP didn't work for me, and it was the only free compiler that I knew of.

Dev C++ always works for me, what didn't work?

Aaron 12-29-2007 06:29 AM

Everything O.o.

The thing would never compile properly. It opened up a DOS prompt and closed it like instantly, and that was what happened. No .exe or anything.


All times are GMT. The time now is 02:40 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0