OK, another one for the gurus please. I have a SUSE leap 42.2 server, setup with LAMP. Web server is working, but I run 2 domains websites on this server, and they have sub directories off the HTDOCS dir. The server does work for php files from the htdocs dir, I have made a info.php test file. However, when I move that info.php file to htdocs/test, for example, it no longer executes, it downloads. How can I fix it so it executes from the two sub-directories??
As you do not post the configurations you used for both directories, we can not compare them and ppoint to differences that might be important.
Also the ownership and the permissions on the different directories (and/or files injside) may differ, thus that the process owner of the http processes (nornaly wwwrun) can not access them.
Sorry about the typo. I’m new to this platform, and at this point I’m trying to FIND the config for the directories concerned. It must be in there somewhere, as if I make a new Dir, PHP files work fine.
I do find the config files difficult to follow - too many placed to look. I started with Httpd.conf but it calls quite a few other files. Going thru them all now, must be in there somewhere…
Still not getting anywhere.
Here are the contents of the config files;
Httpd.conf
Include /etc/apache2/uid.conf
Include /etc/apache2/server-tuning.conf
ErrorLog /var/log/apache2/error_log
<IfDefine !SYSCONFIG>
Include /etc/apache2/loadmodule.conf
</IfDefine>
Include /etc/apache2/listen.conf
Include /etc/apache2/mod_log_config.conf
<IfDefine !SYSCONFIG>
Include /etc/apache2/global.conf
</IfDefine>
Include /etc/apache2/mod_status.conf
Include /etc/apache2/mod_info.conf
Include /etc/apache2/mod_reqtimeout.conf
Include /etc/apache2/mod_cgid-timeout.conf
Include /etc/apache2/mod_usertrack.conf
Include /etc/apache2/mod_autoindex-defaults.conf
TypesConfig /etc/apache2/mime.types
Include /etc/apache2/mod_mime-defaults.conf
Include /etc/apache2/errors.conf
Include /etc/apache2/ssl-global.conf
<Directory />
Options None
AllowOverride None
<IfModule !mod_access_compat.c>
Require all granted
</IfModule>
<IfModule mod_access_compat.c>
Order deny,allow
allow from all
</IfModule>
</Directory>
AccessFileName .htaccess
<Files ~ “^.ht”>
<IfModule !mod_access_compat.c>
Require all granted
</IfModule>
<IfModule mod_access_compat.c>
Order allow,deny
allow from all
</IfModule>
</Files>
DirectoryIndex index.html index.php index.html.var default.html default.htm
Include /etc/apache2/default-server.conf
IncludeOptional /etc/apache2/vhosts.d/*.conf
I have found that this works http:\localhost\info.php but this downloads the file http:\www.domain.com\info.php even though they point to the same location??? Running out of ideas here :(…
Please in the future use CODE tags around copied/pasted computer text in a post. It is the # button in the tool bar of the post editor. When applicable copy/paste complete, that is including the prompt, the command, the output and the next prompt.
Thank for posting the configs. There are several [Direectory] definitions there. I repeat th suggestion tocheck their ownership and permissions. Specialy of those that “don’t work” of course. Thus
I’m not that up on configuration but I’ve just tried using your httpd.conf and vhosts file (and assumed php5.conf is unchanged from installation). I’ve used, eg. test.php in paulins folder.
thanks Henk, will do. the LS-l produces the same output for the dirs and files that work as the ones that dont.
Jon, that is interesting. Just to be clear, you have a leap 42.1 server, and put in my httpd and vhosts, and it worked in your test dir? That is progress of a sort - means im looking in the wrong place! must be a different conf file then. the only change i have made to php.ini is to turn short tags on.
ill copy the info.php to my paulins.net dir - the site is live - and not real important, so you can see the issue on the live server.
To late to edit the above. That Paulins.net website is down from my current location at least, and I won’t be back in the office til tomorrow. Sorry.
Matt
Apache 2.4 on leap 42.1. I replaced my existing httpd.conf with yours and put your vhosts.conf into the vhosts.d folder. There were no other vhosts. I created the folders “paulins” and “neptunes-gear” under “htdocs” and added the php scripts. I added your domains to my local host file, restarted Apache and things “just worked”.
As suggested, just double check your new directores and php files to make certain they are readable by apache - default user is wwwrun.
Well, thanks guys, it’s fixed - but I still don’t know why it was broken. All I did this morning was to go into YAST, open http sever, save the default server as the default, click finish. It restarted the apache service and now it goes…
I’d really like to know what changed, but after wasting so much time on this I need to move on…