0

Sorry if this seems obvious. I'm very new to this, but I've been stuck on this problem for hours even after searching around for similar problems.

I am using the cpanel for managing the files.

Initially, I tried uploading a simple php file, but I kept on getting problems, so I tried an empty php file. This is the error I constantly receive.

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.`

Please contact the server administrator at webmaster@mywebsite.com to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.`

After some more searching, I read about the .htaccess file.

I couldn't find the .htaccess, even after enabling "Show Hidden Files (dotfiles)" in the setting, so I created one. An empty one didn't work. I tried to look for what to place there and tried this.

<IfModule mod_rewrite.c>
   RewriteEngine On

   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-l

   RewriteRule ^(.*)$ file.php?url=$1 [QSA,L]
</IfModule>

In the error of the cpanel, this is what I receive

:error] [pid xxxx:tid xxxx] (12)Cannot allocate memory: [client xxxx] couldn't create child process: /usr/sbin/suphp for /home3/xxxx/public_html/file.php

I also tried to set the file permission to 644, and the folder to 755, but to no avail.

There were some other posts here about the php.ini and some commands in the command line, but I don't really know where to find them. There was also something about apache? but in the cpanel menu, there was only the apache handlers. Any help would be greatly appreciated! Again, sorry. I'm really new and I have no idea what I'm doing.

If it helps, the web hosting that I am using is zoom.ph (not sure if that is the proper term)

  • Possible duplicate of [Getting Internal Server Error while trying to access my site](https://stackoverflow.com/questions/11179706/getting-internal-server-error-while-trying-to-access-my-site) – Dinidu Hewage Jun 04 '17 at 15:33
  • Have you tried contacting your host? – MrWhite Jun 04 '17 at 16:22
  • @Dinidu I've tried the permissions, and it unfortunately does not work. The youtube video appears to have a different error.. – charles_41 Jun 04 '17 at 16:42
  • @user82217 not yet, but I will try to contact the host. I tried a friend's cpanel, and an empty php file does not work either (we both use zoom.ph) – charles_41 Jun 04 '17 at 16:42

2 Answers2

0

if you are using Mac localhost thats is normal because Mac doesn't show .htacces files you can enable hidden files open terminal and enter

defaults write com.apple.finder AppleShowAllFiles YES

after that enter ;

killall Finder /System/Library/CoreServices/Finder.app

this problem has many causes please be sure your project directory is correct ! and change your code with this;

    RewriteEngine On

    RewriteCond %{REQUEST_URI}::$1 ^(.*?/)(.*)::\2$

    RewriteEngine On Options All -Indexes RewriteBase /directoryname/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d

    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteCond %{REQUEST_FILENAME} !-d


RewriteRule ^(.*)$ file.php?url=$1 [QSA,L]
Ahmet ATAK
  • 342
  • 2
  • 13
  • Why change the `.htaccess` code to _that_? (The OP only seemed to create the `.htaccess` file in order to somehow solve this problem - so that's most probably irrelevant anyway?!) – MrWhite Jun 04 '17 at 16:19
  • I tried this and searched my mac. I came up with only an .htaccess.php, which is found in my XAMPP folder. (XAMPP seems to run fine for me, but on the php files do not run on the website for me) (Also, my files are uploaded in a cpanel hosted by zoom.ph. Would my local files affect this? my understanding regarding hosting is very weak) – charles_41 Jun 04 '17 at 16:46
  • .htaccess does not have a php extension, remove the .php from the .htaccess file because .htaccess is the extension itself and therefor the complete filename – K. Tromp Jun 04 '17 at 19:04
  • please be sure your file name is correct because it must be " .htaccess" not any extension it might be changed when you upload to your server please use filezilla file transfer drag drop your .htaccess which you work on it – Ahmet ATAK Jun 04 '17 at 19:51
  • Ah yes. sorry i didn't clarify it. In the cpanel, I created a .htaccess file without the extension. What should I place there? or is an empty one okay? – charles_41 Jun 04 '17 at 23:31
0

Perhaps you already hit the limit of your allowed resources of your hosting, i found this on zoom.ph:

Fair Use Policy

This is where we really shine! Most hosting providers in the Philippines are resellers who are reselling cheap, traditional VPS services of other hosting firms. Often times, these hosting providers oversell their packages to the extent of offering unbelievable packages with unlimited disk and bandwidth, which means that they are selling resources more than the actual resources allotted to them by their parent hosting provider. This oftentimes results to resource hogging causing "500 Internal Server Error". Looks familiar?

Our system is designed to protect tenants from noisy neighbors which means that if one account turns to be consuming resource more than what is allotted for that account, then only that account will run out of resource but the rest of the tenants will be operating normally.

Although we know that diverse customer base will have different hosting package use cases, we cannot allow one account from disrupting shared services. To prevent this, all use cases are governed by our Acceptable Usage Policy or AUP. This AUP protects users from other kind of abuse that cannot be prevented automatically in a shared server environment.

At ZOOM Hosting, you will get the computing resource that you are paying for. We'll allow you to install whatever account level scripts you want to install provided it does not fall under unacceptable materials in our AUP. That's what we advertised and that's what we are giving you. Our packages are carefully designed to serve the needs of almost all business scales, from micro business to a global enterprise. We host small sites such as dental clinics to medium traffic websites such as those of the NGOs and SMEs to high traffic sites such as government, international remittance firm and ecommerce sites getting global visitors daily

K. Tromp
  • 350
  • 1
  • 13
  • I am starting to suspect that it could be the host, but the website I uploaded is a very simple html website with about 5-7~ pages. The php script I'm trying is empty, so I don't think it's me eating up a lot of resources...unless they restrict php by default? – charles_41 Jun 04 '17 at 23:29