How to install PHP 4.4 on Ubuntu?

How can a user copy files to Apache's root folder on Ubuntu?

  • How do i install php, mysql and apache on ubuntu. I have it currently installed but I cannot drag files into the var/www/ folder. Thanks

  • Answer:

    I'm not sure how you can go about dragging and dropping files there, but if you open a terminal and change directory to the folder you have the files in you should be able to copy them like so: 12cd path/to/your/files sudo cp yourfiles.php /var/www sudo will make you run the copy command as the root user, and it will prompt you for a password. The files may still not have the right permissions to execute once you get them there, though. The problem you are having with dragging the files is with permissions. Normal users are not typically permitted write access to the web directory for security reasons. I am not positive what the root Apache folder is in Ubuntu, so you may need to modify the above command appropriately. Also, you may want to consider running your test programs from your home directory by creating a public_html directory in your home directory and copying the files there. Once again, that is contingent on Ubuntu's default Apache configuration, which may or may not allow public_html directories or php execution from them.

John Clover at Quora Visit the source

Was this solution helpful to you?

Other answers

PHP, mysql and apache are already installed in system folders if you installed through apt-get.. Why would you need to drag them into /var/www ? Only webpages are in /var/www. If you are hosting a site on apache, then all the site's files should be stored in /var/www because apache only has access to this folder.. PHP and mysql are installed in the system directories, you don't have to drag them anywhere.. If you need to put files in /var/www, then you can't drag and drop them simply because the X-Server is running as a normal user, ie., under your credentials and hence does not have permission to write into /var/www. To do this, you need to use the terminal. Go to the folder where your files are stored now, lets say you have them on your desktop in a folder: $ cd /home/Desktop/ $ sudo mv ./somefolder /var/www    OR  $ sudo cp -r ./somefolder /var/www

Vinay Bharadwaj

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.