2

I have a webserver (Apache2, configured on Ubuntu Saucy Salamander 13.0x). On this server I have the following file in question: /var/www/xxxxx.com/insertToDB.php

Accessing this file using GET results with 500 Internal Server Error.

I have tried configuring the sites-available/xxxxx.com.conf to the following:

<Files *.php>
    Order Deny,Allow
    Deny from all
    Allow from 127.0.0.1
</Files>

<Files insertToDB.php>
    Order Allow,Deny
    Allow from all
</Files>

(And all other variations of Allow all for this specific file, php extensions wildcards and whats not..).

I have also done the same using .htaccess file directly on the folder where the file is hosted on (in the xxxx.com vhost) and on its parent(s). The 500 internal server error remains.

We have checked all Apache error.log and access.log. Nothing shows any specific error related to PHP5 installation (it works well on other vhosts as well, for index.php files) or version, or anything we could troubleshoot against. Perhaps we didn't search in the right place (?).

At last, I copied the sites-available/yyyy.con.conf (A vhost where index.php files are permitted and working well when accessing from the Web) to the sites-available/xxxx.com.conf file (As displayed below). Yet nothing works.

*The Apache server was reset after each single change :)

<VirtualHost *:80>

# Server name
ServerName xxxx.com

# Document root
DocumentRoot /var/www/xxxx.com

<Directory /var/www/xxxx.com>
            Options Indexes FollowSymLinks
            AllowOverride All
            Order allow,deny
            allow from all
        </Directory>

        # only allow access to insertToDB.php file
        <Files  ~ "\..*">
            Deny from all
        </Files>

        <Files insertToDB.php>
            Allow from All
        </files>


# Custom log file locations

</VirtualHost>
  • For the record - The PHP file in question (insertToDB.php) was tested to be working on a $4 a month Bluehost hosting and was working perfectly. In includes a very simple POST using CURL lib. It delivered no errors or so on the server where it was tested to be working on. Also - The filename was decapitalized also on some point to verify this is not the issue. The PHP log file is limited to 128MB (Not the issue either).

Any help would be VERY much appreciated.

Orr Yoffe
  • 21
  • 2
  • You don't mention it, but have you already checked obvious permissions problems with the file? – dawud Jun 18 '14 at 20:53
  • Yes I tried and changed the files, folders and top-folders permissions to most possible variations. Nothing.. – Orr Yoffe Jun 19 '14 at 11:27
  • I assume directly executing the script works OK? Also, do you have `/var/www` mounted with `noexec` – dawud Jun 19 '14 at 11:29
  • Yes. It works 100% on any other properly configured server (its on Bluehost serving right now). – Orr Yoffe Jun 21 '14 at 14:17
  • Have you tried putting any other `php` file in that directory (a simple `phpinfo()`, for example) to rule out a problem with the script itself? – dawud Jun 21 '14 at 14:28
  • Nope, not sure what you mean (I didn't write those PHP scripts). – Orr Yoffe Jun 22 '14 at 11:14
  • I mean replacing the php script that doesn't work with a simple `` so you can test if the webserver is able to render it or not. – dawud Jun 22 '14 at 12:19
  • Now I did. Yes, the server reads the phpinfo() well as you described when accessing from the web. Going back to permissions issues I assume – Orr Yoffe Jun 22 '14 at 14:50
  • This entirely rules out problems with the webserver or its configuration. Not knowing the contents of the `insertTODB.php` script, there's little more to do. – dawud Jun 22 '14 at 14:59
  • `http://dev.adwingate.com/rag/insertToDB.txt` – Orr Yoffe Jun 22 '14 at 16:24
  • I do have CURL scripts on this server running and working, so the CURL lib must be installed correctly. – Orr Yoffe Jun 22 '14 at 16:25
  • is `php5-json` installed? – dawud Jun 22 '14 at 17:38
  • installed php5-json and php5-curl again. fixed the whole issue – Orr Yoffe Jul 02 '14 at 17:43

0 Answers0