Followed the instructions pretty much step for step, from Apache to down to the mysql steps, but when I visit my webserver's address I only saw my apache start page. So I moved all of the drupal stuff into a subdir called /drupal. Going there only lists the directory's contents, and clicking on install.php only shows its code.

I'm probably doing something really stupid, but is there a reason I'm not seeing the Drupal installation page? How do I get it to run install.php?

Running Centos 7 and trying to install Drupal 7.

Thanks!

Comments

John_B’s picture

It can be a pain installing in a sub-folder and I would suggest using a subdomain (though intstalling in a sub-folder is certainly possible).

However, in this case you you have not reached a Drupal-specific issue of that kind yet. Your server is not configured correctly to execute php. It is not really a Drupal question, it would be the same for any software which requires execution of php.

You need to talk to the person who set up / configured the server. If that is you, you should state what method of executing php you use. The easiest to get it working is mod_php. You may need to ensure Apache has mod_php enabled, and is configured to use it, maybe AddHandler php5-script .php in your httpd.conf and restart Apache would do it. The details depend on your setup.

In case you still suspect it is a Drupal problem you can just trying executing a phpinfo file (Google if you need instructions how to make it). If that does not work, you know the server is not configured to use php, and it is too soon to move on to the Drupal installation.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

drugan’s picture

If you see "apache start page" instead of drupal installation page that means only one: your apache page is still in the server root directory (public_html, htdocs, www or similar).

1. Delete everytning that you have there. (including .htaccess file, cgi-bin directory, etc..)

2. Create your own index.php file witn this this content:

echo "<h1>My root is eligible for installing drupal!</h1>";

3. Put this file in your root directory and try to see it in a browser visiting http://yoursite.com

4. If you do NOT see the page with "My root.." ask your hosting provider to set up your VirtualHost. If you DO see - delete your index.php.

5. Unzip drupal archive in your root directory.

6. Move all the content of your unziped drupal-7.?? folder one step above, i.e- to the root directory (public_html, htdocs, www or similar). Do not lost drupal .htaccess file on this operation.

7. Delete the archive and drupal-7.?? folder which is empty now.

8. Go to sites/default and duplicate the default.settings.php file. Rename the duplication for settings.php

9. Create a database writing down the name of it, user of it and password on a piece of paper.

10. Go to http://yoursite.com and install drupal following instructions on the screen.

trumpetmercenary’s picture

Thanks so much to both of you, I got it! If anyone else ever has this problem, here are some steps I followed:
- Moved Drupal to /var/www/html as John_B suggested
- Installed PHP again (I can't remember how I did it last week)
- Added AddHandler php5-script .php and LoadModule php5_module modules/libphp5.so...CentOS is a little confusing about where this goes, so I added it to httpd.conf and also php.conf in /etc/httpd/conf.d just to be safe
- Restarted Apache
- Put a basic phpinfo file in the html folder to make sure PHP was working (it was)
- At this point, my site was pointing to localhost/install.php, which was encouraging. But still showing code. Then, put drugan's code

<?php
echo "<h1>My root is eligible for installing drupal!</h1>";
?><code>

in the index.php file...after the stuff that was already in there. This just made the site load up as blank. So I commented it out, and for some reason, all of a sudden the Drupal installation page was there!

So the installation went through and I'm able to create modules and such. It's giving me database errors on every page load now, but that's probably just mysql related and for a different thread.

Thanks so much for the help, much appreciated!

John_B’s picture

To further simplify it is worth setting up an Apache virtual host. On a local machine you may need to edit your hosts file so the browsers recognizes the host's name.

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

ceasaralvarez’s picture

I am having exactly the same problem I followed the instructions from Apache to the mysql steps, but every time I visit my webserver's address I only see my apache start page.

I followed the following steps below and still not working??

1. Delete everytning that you have there. (including .htaccess file, cgi-bin directory, etc..)

2. Create your own index.php file witn this this content:

echo "<h1>My root is eligible for installing drupal!</h1>";

3. Put this file in your root directory and try to see it in a browser visiting (your site)

4. If you do NOT see the page with "My root.." ask your hosting provider to set up your VirtualHost. If you DO see - delete your index.php.

5. Unzip drupal archive in your root directory.

6. Move all the content of your unziped drupal-7.?? folder one step above, i.e- to the root directory (public_html, htdocs, www or similar). Do not lost drupal .htaccess file on this operation.

7. Delete the archive and drupal-7.?? folder which is empty now.

8. Go to sites/default and duplicate the default.settings.php file. Rename the duplication for settings.php

9. Create a database writing down the name of it, user of it and password on a piece of paper.

I am fulling my hair hair out, why doesnt it work?

John_B’s picture

4. If you do NOT see the page with "My root.." ask your hosting provider to set up your VirtualHost. If you DO see - delete your index.php.

Where did you get that advice? Certainly if you delete index.php your Drupal site will not work.

Have you set up a Virtual Host, and put the Drupal files in the document root for that Virtual Host?

Digit Professionals specialising in Drupal, WordPress & CiviCRM support for publishers in non-profit and related sectors

drugan’s picture

1. What is an "apache start page"?

Usually it is an index.php file which resides in your root directory and it gives us the following text in a browser:

It works!

2. Where do I find my "root directory"?

On your Windows OS it might be: C:\???\xampp\htdocs

On your Linux OS it might be: /var/www

On your web hosting it might be: /home/yourname/public_html

On any OS it might be: any/folder/you/can/think/of

3. It appears not only index.php file there but other stuff too. What I have to do with this?

DELETE THEM ALL!

OR...

move to another location if you still need it.

4. Ok, it's clean and I've created there my own index.php file with this text inside. What's now?

echo "YESSS!!!";

If it is your computer go to: http://localhost

If it is not your computer (web hosting you've buyed) go to:

http://yourlovelydomainname.com

OR...

http://yourprettydomainname.net

...OR similar.

5. Well, I see this "YESSS!!!"...

Congratulations!

Now you need to decide how much drupal sites you want to install. Usually if you on a web hosting you install only one drupal site in a single root directory but if you on your own computer (localhost) you might be wanting to install many drupal sites (or any other sites) in one root directory.

Let's check how it looks like:

a. Create a folder in you root directory and name it barrr

b. Copy->paste your index.php file with "YESSS!!!" into the barrr folder.

c. Copy barrr folder and paste into the same place (root directory) renaming it for bazzz

d. Go to these URLs http://localhost, http://localhost/barrr, http://localhost/bazzz and everytime you should see your "YESSS!!!" text. These are your "sites", i.e- all the places where an index.php file is found in the root directory (sometimes called web root or document root).

e. Go back to your root directory and delete everything that your created there earlier.

f. Start from the step 5 and install drupal. Note that when you unzip drupal archive in your root directory you'd have a folder called drupal-7.x so rename it for whatever name you want, e.g.- kittyyy and then visit http://localhost/kittyyy to install drupal

OR...

cut off all the content from the drupal-7.x folder and paste it one step above, i.e.- into the root directory. Then install drupal visiting http://localhost

6. I do NOT see this "YESSS!!!" and still having apache start page in the browser!

If you on a web hosting ask them to help you because mostly you don't have sufficient permissions to set your root directory up there.

If you on a localhost you can set any folder on your computer as a root directory and have many of them. I'll give you command line example for Ubuntu OS with lamp package installed which may be appropriate for some other Linux distributions. Before running this set of commands consider the value of MYROOTPATH and MYROOTURL variables and change them for location/url you desire (e.g.- MYROOTURL="kittyyy.dev" to have http://kittyyy.dev as a URL for your root directory). In this example it creates mysites root directory on your Desktop and asigns the same name for url, i.e.- http://mysites. Also it downloads drupal, unzips it and then redirects you to your browser to install drupal, i.e.-http://mysites/mydrupal

a. Open terminal (Ctrl+Alt+T), copy->paste the text below into the terminal prompt and press Enter.


sudo -v;export MYROOTPATH=$HOME/Desktop/mysites;mkdir $MYROOTPATH;export MYROOTURL=$(basename $MYROOTPATH);sudo echo -e '<VirtualHost *:80>\nServerAdmin webmaster@'$MYROOTURL'\nDocumentRoot "'$MYROOTPATH'"\nServerName '$MYROOTURL'\n# This should be omitted in the production environment\nSetEnv APPLICATION_ENV development\n<Directory "'$MYROOTPATH'">\nOptions Indexes MultiViews FollowSymLinks\nAllowOverride All\nOrder allow,deny\nAllow from all\n</Directory>\n</VirtualHost>\n'>/etc/apache2/sites-available/$MYROOTURL;sudo sed -i '1i 127.0.0.1\t'$MYROOTURL /etc/hosts;sudo a2ensite $MYROOTURL;sudo service apache2 reload;cd $MYROOTPATH;wget http://ftp.drupal.org/files/projects/drupal-7.32.tar.gz;tar -xzf drupal-7.32.tar.gz;mv drupal-7.32 mydrupal;rm drupal-7.32.tar.gz;ls mydrupal;echo -e "$(tput bold setaf 1)$(tput setab 3)This is your drupal\nLet's see how it looks like in a browser now...$(tput sgr 0)";xdg-open http://$MYROOTURL/mydrupal

Of course, you can go further and install drupal automatically using drush but I think that is not relevant to the question in this post.