This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Code obfuscator for php?
Can I encrypt PHP source or compile it so others can’t see it? and how?
How is it possible to protect PHP code?
I want to encrypt PHP code so that others should not modify and cannot view the code. If I run that encrypted PHP file in the browser its functionality should work.
I have used few codes and some software like PHP Bambalam PHP EXE Compiler/Embedder ,phc-win,zzee php etc., with those I am able to encrypt PHP code but failed to run in the server. It was showing Php encrypted code instead of its functionality.
Can any one suggest me a way to encrypt a file which should be free and run that encrypted code in the server?
For ionCube (which I use), you also need the loaders installed on your server:
http://www.ioncube.com/loaders.php
Something must decrypt the file.
You don't need to do this. PHP code is run on the server, the browser never downloads it.
Related
This question already has answers here:
How can I run a php without a web server?
(4 answers)
Closed 2 years ago.
i know there are many similar questions but tbh none of them really fit.
I have no problems running the php part of my Webpage and everything works fine. Now im asking if there is a way to run my webpage including the php part without using having to start apache and typing in localhost.
I just wanna open up my html document with a browser and display it, nothing else. However then, the php code isnt really executed but its necessary for me as it displays an essential table with data. And no I cant use javascript for a very specific reason. I have to use php for my project but its a bit inconvenient having to start apache everytime and i just want to open up the document with firefox for example.
Unfortunately, this will not be possible as PHP is a server side language. As such, you will have to have an application to serve the content. With HTML, you are able to open it directly and display as the client (Browser) is able to read it directly. Browsers do not read PHP - when the server compiles the PHP, it is only sending the DOM (HTML, etc.) to the browser.
Like other people said, PHP is a server side language so you need to run a server on your machine.
But maybe you could try using small local server like the Symfony Local Server
It should be faster to start than apache.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Question about php and dreamweaver?
I am having alot of trouble running my php file. I downloaded XAMPP and have both Apache and MySQL running. Do I need to save the file in a certain place, and what does Dreamweaver mean when it says:
To preview pages containing server-side code, you need a testing server. Would you like to specify one now?
I have good enough knowledge in HTML and CSS, and have gotten websites running, but I can't seem to get PHP to work. When I just run the code from google chrome plainly it looks like this:
"Hello World"
"; phpinfo(); ?>
You can put your PHP-files into the xampp/htdocs folder, e.g. xampp/htdocs/hello.php and then open it in your browser at http://localhost/hello.php.
The URL must say localhost or whatever you set it to in order to render a PHP page. You also need to make sure PHP handlers are working and correctly parsing PHP files.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
PHP auto minify. Is there any?
I'm using PHP minify (http://code.google.com/p/minify/)
I have to go to my webpage, create the url's, click upload, copy the the link of the new compressed file into my PHP file as explained here: http://www.mrclay.org/2008/09/19/minify-21-on-mrclayorg/
This works fine, but how can this be automated? Is there a PHP class for this or can I use one of the PHP classes already included in minify?
I think you have two main options really.
Use cURL to call the google code minifier. http://php.net/manual/en/book.curl.php
Use a different minifier that you can run locally. Try:
http://developer.yahoo.com/yui/compressor/ (Requires Java runtime)
http://www.crockford.com/javascript/jsmin.html (Windows only)
You can write a wrapper with CURL to send your files to the server, gets the returned text and outputs it to the client.
Beware, though, that it will slow down your server a lot (it will minify the code every time someone asks for it). So you would need a caching mechanism to do it only once.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Can you “compile” PHP code?
After I write an application in PHP, why can't I compile it into machine language? I know that it's possible to make a byte-code version of the file, which (as I understand it) is basically a file that has already been parsed into tokens.
But that's not what I want. Clearly it can't work in a general sense, since compiled code will be platform-specific, but let's say I have chosen a given platform. Why can't I create a binary file that would be the same code that PHP would run when given my .php file?
You can, facebook released a project which is currently being updated for php 5.3 (supports everything lower iirc) called HipHop, you can find it here: https://github.com/facebook/hiphop-php
There are a few compilers out there like facebook's, mentioned by #Howard, or http://www.roadsend.com/home/index.php?pageID=compiler. I've never tried them though.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Minify / Obfuscate PHP Code
I have a php file. Anyone knows of any encryption technics/keys to encrypt the code? I don't want to make it human readable. I was thinking if i could include the encrypt keys in an include file hosted separately somewhere. Any help and ideas?
Are you looking for something like Zend Guard ?
Zend Guard, the most widely accepted PHP encoding and obfuscation product on the market, protects your application from unlicensed use and reverse engineering.
I think the best way is to obfuscate the code. i've never do that on php, but i use yui for JS Code. I google'it and found http://www.codeeclipse.com/. Try that.
Nobody who cares a bit about security is going to use your app if it wants to include - e.g. EXECUTE - code from your server, loaded at runtime.
The only real solution if you really need to encrypt your code (usually you don't!) is buying ioncube or zend encoder to compile the PHP code to a bytecode which is then executed by a zend extension in the PHP core (i.e. the user needs to be able to load php extensions)