matstuff Posted December 5, 2007 Share Posted December 5, 2007 Hi, I'd like to install PHP to run on my local machine, such that if I open a file in Firefox etc., it runs the script and outputs the HTML correctly. *However*, is there any way of doing this without having to install a webserver? I'm using a machine in a University network with [understandably] somewhat restrictive policies - i.e. I can't run a webserver! However, I need to write an interface for MySQL, and VB Express is shite! Any suggestions would be much appreciated. Cheers, Mat Quote Link to comment Share on other sites More sharing options...
aschk Posted December 5, 2007 Share Posted December 5, 2007 No, in a word. In order for the PHP parser to work it needs to be installed, and thus you also need a webserver (most commonly apache) to process the service request and send it to the Zend engine. So opening up a file in the browser will not work, it will merely read the text that is contained within that file. Quote Link to comment Share on other sites More sharing options...
jaymc Posted December 5, 2007 Share Posted December 5, 2007 You will need some kind of parsing engine Even specified programs often need apache etc running in the background to parse off and output I think your screwed, unless there is some kind of all in one program, I've never heard of one, and if there is, what are the chances of installing it on network pc? What I would do, and this is more advice than solution to original query, is set up apache etc on your computer at home, with ftp on it and work in uni but upload scripts to home PC Thats what I used to do. Please tell me you have internet at home? Or, bring your laptop in? (Assuming you have a laptop of course ) Quote Link to comment Share on other sites More sharing options...
aschk Posted December 5, 2007 Share Posted December 5, 2007 I'm taking a stab in the dark here, but i'm guessing that you need to write this interface for a University project? Thus, I would imagine that the University would provide you with the tools for this job would they not? Or do they expect everyone to install/maintain/setup their own webservers? Thus I would guess they provide an IDE for you, which usually can be used to parse the code you're writing... If it's not a Uni project (and thus you don't have the tools) then go home and do it. You can't install anything (because of policy) so it's not going to get any easier for you to do what you need. Quote Link to comment Share on other sites More sharing options...
matstuff Posted December 5, 2007 Author Share Posted December 5, 2007 Bugger. Cheers guys. I suspected as much No, it's not a project. It a database we need in our group. I was using Access, but for no reason that started crashing. I could obviously just use an online server - my ISP supports mysql and PHP, but the nature of the data means that it's sensitive enough not to be online. The crux of it is just being able to implement a GUI for the database (but not an Admin GUI) Not to worry, thanks for your help. Mat Quote Link to comment Share on other sites More sharing options...
aschk Posted December 5, 2007 Share Posted December 5, 2007 PHPMyAdmin is an excellent interface for MySQL (online). So should you ever decide that your data is safe on your web host (which it should be, so long as SQL User permissions have been set properly) then feel free to use this utility. It allows viewable data and you can execute queries against it should you need to. It isn't however a reporting tool, which is what you need I suspect. Quote Link to comment Share on other sites More sharing options...
matstuff Posted December 5, 2007 Author Share Posted December 5, 2007 Like I said, I'm not after an administrative interface. I want something that will allow me to design a custom input form. PHPMyAdmin is good for setting up and administering the structure etc. of a database, but you can't give it to users to do things with. Quote Link to comment Share on other sites More sharing options...
biocyberman Posted December 5, 2007 Share Posted December 5, 2007 @matstuff I would say you pick up one of the followings: 1. Ask university administrator for permission to install web server software (i.e. Apache) 2. By a webspace from hosting provider (about 100 USD/year can solve the problem perfectly). 3. Try searching if you can run Appache without installation (I tried googling but nothing good showed up) Quote Link to comment Share on other sites More sharing options...
revraz Posted December 5, 2007 Share Posted December 5, 2007 I've seen a few PHP Editors that include the php engine in it for previewing. Some of them even mentioned you could use a External Browser to preview as well. Do a search for PHP Editors. Quote Link to comment Share on other sites More sharing options...
trq Posted December 5, 2007 Share Posted December 5, 2007 Its probably not really what you want, but you could use php cli to render your scripts into html then view the output in a browser. It would seriously be a pain though. You'd need two scripts. Once to render the pages. render.php #!/usr/bin/php <?php if ($argc == 1) { ob_start(); include $argv[1]; file_put_contents('tmp.html',ob_get_clean()); } ?> And another to execute and then distroy. view.php #!/usr/bin/php <?php if ($argc == 1) { exec("render.php {$argv[1]}"); exec("/usr/bin/firefox file://tmp.html"); exec("/bin/rm tmp.html"); } ?> Then all you would do is execute something like... $ view.php mypage.php None of this is at all tested, but it might give you some ideas. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.