ubuntu eclipse lampp stack php internal server error

426 views Asked by At

I am running Ubuntu 12.04 with the standard lampp stack with the l*calhost at var/www. There is a symbolic link ('git') to my eclipse workspace 'user/Documents/workspace'. I have set permissions for the workspace folders using 'sudo chmod 644 .' and in the httpd.conf in etc/apache2/sites-available I have changed it to read:

# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
#User daemon
User cjmartin
Group daemon

If I run an html file that does a callback to a php file on my remote server it works, but if I use the same php file in my eclipse workspace I get:

"Failed to load resource: the server responded with a status of 500 (Internal Server Error) http://l*calhost/git/CrystalliseCalculators/CrystalliseCalculators.php?q={%…nd+Wales&searchTerms%5Bmodel_name%5D=Crystallise+model+1.0&_=138651239125"

Normal html files run normally from the worskpace, but not a php call. I assume this is a problem with the permissions. Any ideas?


The callback code:

...
var path1 = "http://l*calhost/git/CrystalliseCalculators/"
...

function doIt(){
            strSearch = "The search terms"
            var theCalla = path1+"CrystalliseCalculators.php?q="+JSON.stringify(strSearch);

            // Call the Crystallise API to fetch central mortalities.
            $.ajax({
                url:theCalla,
                type:'GET',
                dataType:"jsonp",
                jsonp:"callback",
                data:strSearch,
                success:function(dataBack){     
                    //Do stuff with the results....
                },
                    error:function(errorData1){
                    alert("error msg"+JSON.stringify(errorData1));
                }           
            });
        };      
1

There are 1 answers

0
cjmartin0 On

This was not a permissions problem for the relevant files and folders as it turned out. The problem was in a database call inside the php file that failed silently.