Leahcim
Leahcim

Reputation: 41919

PHP - Terminal/Command line - Mac

I'm following a video tutorial that is developing a project in PHP. The teacher is building the site on a local server, but I am doing it directly onto a website on a shared hosting plan. At one point in the tutorial, the teacher is using the command line on his computer to change file permissions. Is it possible for me to connect to the webserver on a shared hosting plan from the terminal/command line on my Mac? if so, how to do it?

Upvotes: 0

Views: 1316

Answers (4)

Jochem
Jochem

Reputation: 3387

You could use the exec function in PHP to execute simple commands on the command line. More details of this function you find at: http://php.net/manual/en/function.exec.php

If it is something that you need to do more often you can also consider building a very basic terminal application in PHP, which allows you to insert command in a HTML input box and executes it via the command line. The reply from the command line can be published in the HTML page.

Upvotes: 0

greg0ire
greg0ire

Reputation: 23255

You can do this using your ftp client (Filezilla?)

Upvotes: 0

Infotekka
Infotekka

Reputation: 10423

The most common method would be to use SSH. Your mac should have an ssh client built in.

ssh yourhostname.com

This of course all assumes that your provider allows ssh access.

Upvotes: 1

JamesHalsall
JamesHalsall

Reputation: 13475

You need SSH access to your web server, so you might need to get in touch with your provider and find out if this is available to you.

You can SSH from your terminal to your webserver like:

ssh user@webserveraddress

Upvotes: 1

Related Questions