• 0

Accessing Phing/PHPUnit On Shared Hosting


Question

Right, I'm not sure whether this is just an absolutely crazy idea but I'm trying to use Phing and PHPUnit on a project but the web server I have them installed on is shared hosting :( and I can't access the command line as the host doesn't allow it.

I want to play around with PHPUnit first, and I know you can implement it through Phing. So looking at the Phing executable it just runs the phing.php file in the PEAR directory.

What would be the best way around the no CLI? I had a crazy thought about creating a web script that would convert form input parameters into command line arguments and then call the phing.php, but I have very little idea how to hand the CLI output streams?

Any ideas?

Thanks

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

You could try using PHP system calls to run commands on the server, not sure if it would have the required permissions though.

Otherwise, if it does just call phing.php from PEAR then you should just be able to include this from your script and run it yourself maybe?

Link to comment
Share on other sites

  • 0

Just get a host that allows SSH access, I don't understand how anyone can live without it.

Edit: Also, you should be doing testing locally. It's an irresponsible waste of resources to be running it on a production server.

Link to comment
Share on other sites

  • 0

Well I'm now starting to see why a host with SSH would be helpful.. The host we have at the minute is very limited in terms of SSH (not even SFTP, only FTPS, which is supported by very few FTP clients).

Knad, I doubt we'd have the required permissions, and it sounds a bit hit and miss :/

Kudos, I see your point about running on the production server but my main issue is this. We're only a small company (well actually I'm the only developer, if I can even call myself one) and we don't have a full time testing server in house right now as we're only just starting the project fully. So at the minute I'm running tests on a secured subdomain on the shared hosting, which is obviously not ideal for resources and it also presents the issue I'm at now.

Alternatively I could install PHP on one of the normal work computers and develop on there, but then if I want to work at home, I would have to either do the same here and synchronise the files at snail speed or set up a webserver/SSH on that computer, which more than likely when I go to connect will be turned off or unplugged by somebody.

As you can probably tell, I'm still learning, so do you have any suggestions on a system where I could run command line PHP and access the development files in multiple locations? Is the only solution to go the full nine yards, get a proper internet connection and a development server?

Link to comment
Share on other sites

  • 0

Dropbox would be a simple way of syncing your development web directory to various machines.

At a minimum, a virtual machine simulating your production environment should be what you are using for development and testing. You can do this for free and run it on your desktop computer. Once you've got it all configured, you can copy this VM image to your home computer and use it there too. You can develop and run your tests here, deploying to the shared hosting when you reach your goals.

You should also be running a version control system such as Git or SVN to track changes to your code.

Link to comment
Share on other sites

  • 0

Definitely an idea. I should be able to duplicate the environment in a VM easy enough, and Dropbox would certainly be easy to access.

Where do you suggest I run git/SVN, on the on one of the work desktop machines? If I'm running it on the desktop machine, then I wouldn't easily be able to see revisions and similar from home, where a lot of coding also gets done.

I have been reading up on version control recently but the basics seem to escape me, so sorry once again more than likely ridiculous questions..

Thanks

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.