I have designed a page that has upload attachments ... one image and another PDF.
The data is created in the database, however, when trying to upload a file of either type I get a server error "File Size is zero bytes".
A search of this forum yielded entries that indicate it is a permission issue of site assets folder or assets/Uploads folder. I have checked both and the permissions are correct.
The search on other platforms seems to indicate file size issues are from the PHP5.6 php.ini file settings. Both are correct and set to a value well above the 8Mb default.
The Apache2 log looks like:
[Tue Jun 06 15:11:57.167558 2017] [:error] [pid 26971] [client 192.168.1.73:50192] PHP Warning: mkdir(): Permission denied in /var/www/html/ss/framework/filesystem/Filesystem.php on line 53, referer: http://192.168.1.70/ss/index.php/admin/pages/edit/show/23
[Tue Jun 06 15:11:57.170810 2017] [:error] [pid 26971] [client 192.168.1.73:50192] PHP Warning: copy(/var/www/html/ss/assets/Uploads/news-attachments/the-satern-ring.pdf): failed to open stream: Permission denied in /var/www/html/ss/framework/filesystem/Upload.php on line 207, referer: http://192.168.1.70/ss/index.php/admin/pages/edit/show/23
This code also seems to indicate a permission issue. The folders all have the owner as root group as root and drw-rw----, files can be uploaded manually but not through the CMS.
So where do I look now?
Environment:
SS v3.6.0 theme bootstrap
OS Linux Mint 18.1
Apache 2.4 PHP 5.6
This can occur when framework does not have permission to write files to the server. If this is the case, when we upload images through the CMS the file can not be written to assets and the CMS returns a "File size zero error". The website also cannot combine files (such as JavaScript and CSS files) and cannot create new resampled images.
To help investigate this problem we can run the SilverStripe install wizard. The install wizard will notify us of issues preventing SilverStripe from running correctly.
To run the install wizard we visit http://www.example.com/install.php
The install.php is usually deleted after the site is installed, so if it is missing we will need to replace it. We can download the file from github. Here is the install.php file for SilverStripe 3.6: https://github.com/silverstripe/silverstripe-installer/blob/3.6/install.php
Once downloaded we upload this to the root directory of our webserver. Once this is done we can visit the install.php URL.
Here is a screenshot showing an example of the file permission issue warnings that the install wizard outputs:
What we want to do now is fix up all the warnings that the install wizard is reporting.
If this is a shared hosting environment we might not have the ability to fix these issues ourselves. In this case we should be able to send the install.php link to hosting support asking them fix the issues.
Once all the issues are fixed the site should work correctly. Make sure to delete the install.php when we are done.
I am running an Windows Server 2008 R2 Enterprise with an Apache Server installed and mod_perl & mod_ssl
I just installed Apache2::ModSSL, but i was not able to use cpan for this and had to compile it using nmake. CPAN is not working correctly on this Server and i am not able to change this.
A perl script called via https should later be able to Access the certificate the Clients used to authenticate, thats why i want to use Apache2::ModSSL to Access the SSL variables.
When i try to acess my test script after implementing
use Apache2::ModSSL;
i get an HTTP500 error from the Server.
The Servers error log states
[Fri Jul 01 15:01:58 2016] [error] [client 10.217.139.184] failed to resolve handler `ssl::hello': Can't load 'C:/Apache/Perl/site/lib/auto/Apache2/ModSSL/ModSSL.dll' for module Apache2::ModSSL: load_file:The specified module could not be found at C:/Apache/Perl/lib/XSLoader.pm line 68.\n at C:/Apache/Perl/site/lib/Apache2/ModSSL.pm line 8\nCompilation failed in require at ssl/hello.pm line 7.\nBEGIN failed--compilation aborted at ssl/hello.pm line 7.\nCompilation failed in require at (eval 3) line 3.\n
When i check the file Location, ModSSL.dll is stored at exact this path. I also checked the file Access and granted Full acess to All Users, System, Administrators etc. Apache was restarted multiple times and it did not Change anything.
When i tried to execute it in a cmd, obviously there was no Connection to check but i could execute
use Apache2::ModSSL;
print Apache2::ModSSL->VERSION;
without Problems.
How to solve the issue with loading the module within Apache?
Server readme states
This is a binary distribution for Win32 of Perl 5.8.7 and Apache
2.0.54, together with mod_perl-2.0.1, mod_ssl / OpenSSL (0.9.7g), and php-4.3.11, all built with VC++ 6.0 (SP5).
cl -version states
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
nmake -version states
Microsoft (R) Program Maintenance Utility Version 9.00.30729.01
Without investigating too deeply, the most likely reason for your problem is that perl, OpenSSL, mod_ssl etc where compiled with a different compiler than the one you used to build Apache::ModSSL.
It seems to me that the module only tries the XS version if it thinks it's running under mod_perl. You can see this in the module's Apache2/ModSSL.pm:
XSLoader::load __PACKAGE__, $VERSION
if( exists $ENV{MOD_PERL} and $ENV{MOD_PERL}=~/mod_perl/ );
It only tries to load the XS component if the MOD_PERL environment variable exists and it contains mod_perl. My guess is if you did:
C:\> set MOD_PERL=mod_perl
C:\> perl -MApache2::ModSSL -e "print $Apache2::ModSSL::VERSION"
you would encounter problems.
In addition, I feel I must emphasize the facts that your OpenSSL version in addition to perl and php seem too old to be used safely.
I am trying to deploy a Flask web app with tensorflow on an AWS server ( AMI ID: Deep Learning (ami-77e0da1d)), for an image classification app.
When I use tensorflow in the server, it works normally, but when I try to use it with the app, I get:
No data received ERR_EMPTY_RESPONSE
In the end of the error.log file, I have:
F tensorflow/stream_executor/cuda/cuda_dnn.cc:204] could not find cudnnCreate in cudnn DSO; dlerror: /usr/local/lib/python2.7/dist-packages/tensorflow/python/_pywrap_tensorflow.so: undefined symbol: cudnnCreate
[Sat May 14 11:30:54.124034 2016] [core:notice] [pid 1332:tid 139695334930304] AH00051: child pid 2999 exit signal Aborted (6), possible coredump in /etc/apache2
My CuDNN version: 4.0.7
I can provide more details if necessary
The value of LD_LIBRARY_PATH is being cleared before starting your web app starts, for security reasons. See for example this question, which observes that the value of os.environ['LD_LIBRARY_PATH'] is empty inside the Flask app, even though it may be set when you launch Apache.
There are at least a couple of options:
You could use Apache's mod_env to set the environment variables that are propagated to your Flask app.
Based on this answer, you could modify your script to perform a subprocess call, and set the LD_LIBRARY_PATH to /usr/local/cuda/lib64 for the subprocess.
I solved my problem by deploying on a CPU instead of a GPU, and it was enough for me.
Apache on Windows gives me the following error when I try to access my Perl script:
Server error!
The server encountered an internal error and was unable to complete your request.
Error message:
End of script output before headers: sample.pl
If you think this is a server error, please contact the webmaster.
Error 500
localhost
Apache/2.4.4 (Win32) OpenSSL/1.0.1e PHP/5.5.3
this is my sample script
#!"C:\xampp\perl\bin\perl.exe"
print "Hello World";
but not working on browser
Check file permissions.
I had exactly the same error on a Linux machine with the wrong permissions set.
chmod 755 myfile.pl
solved the problem.
If this is a CGI script for the web, then you must output your header:
#!"C:\xampp\perl\bin\perl.exe"
print "Content-Type: text/html\n\n";
print "Hello World";
The following error message tells you this End of script output before headers: sample.pl
Or even better, use the CGI module to output the header:
#!"C:\xampp\perl\bin\perl.exe"
use strict;
use warnings;
use CGI;
print CGI::header();
print "Hello World";
For future reference:
This is typically an error that occurs when you are unable to view or execute the file, the reason for which is generally a permissions error. I would start by following #Renning 's suggestion and running chmod 755 test.cgi (obviously replace test.cgi with the name of your cgi script here).
If that doesn't work there are a couple other things you can try. I once got this error when I created test.cgi as root in another user's home. The fix there was to run chmod user:user test.cgi where user is the name of the user who's home you're in.
The last thing I can think of is making sure that your cgi script is returning the proper headers. In my ruby script I did it by putting puts "Content-type: text/html" before I actually outputted anything to the page.
Happy coding!
Probably this is an SELinux block. Try this:
# setsebool -P httpd_enable_cgi 1
# chcon -R -t httpd_sys_script_exec_t cgi-bin/your_script.cgi
Had the same error on raspberry-pi. I fixed it by adding -w to the shebang
#!/usr/bin/perl -w
You may be getting this error if you are executing CGI files out of a home directory using Apache's mod_userdir and the user's public_html directory is not group-owned by that user's primary GID.
I have been unable to find any documentation on this, but this was the solution I stumbled upon to some failing CGI scripts. I know it sounds really bizarre (it doesn't make any sense to me either), but it did work for me, so hopefully this will be useful to someone else as well.
Since no answer is accepted, I would like to provide one possible solution. If your script is written on Windows and uploaded to a Linux server(through FTP), then the problem will raise usually. The reason is that Windows uses CRLF to end each line while Linux uses LF. So you should convert it from CRLF to LF with the help of an editor, such Atom, as following
If using Suexec, ensure that the script and its directory are owned by the same user you specified in suexec.
In addition, ensure that the user running the cgi script has permissions execute permissions to the file AND the program specified in the shebang.
For example if my cgi script starts with
#! /usr/bin/cgirunner
Then the user needs permissions to execute /usr/bin/cgirunner.
Internal error is due to a HIDDEN character at end of shebang line !!
ie line #!/usr/bin/perl
By adding - or -w at end moves the character away from "perl" allowing the path to the perl processor to be found and script to execute.
HIDDEN character is created by the editor used to create the script
So for everyone starting out with XAMPP cgi
change the extension from pl to cgi
change the permissions to 755
mv test.pl test.cgi
chmod 755 test.cgi
It fixed mine as well.
In my case I had a similar problem but with c ++ this in windows 10, the problem was solved by adding the environment variables (path) windows, the folder of the c ++ libraries, in my case I used the codeblock libraries:
C:\codeblocks\MinGW\bin
This is my case.
Only two line in the script:
#!/usr/bin/sh
echo "Content-type: text/plain"
give the error 500.
adding this line, after the first echo:
echo ""
don't give the error.
Basing above suggestions from all, I was using xampp for running cgi scripts.
Windows 8 it worked with out any changes, but Cent7.0 it was throwing errors like this as said above
AH01215: (2)No such file or directory: exec of '/opt/lampp/cgi-bin/pbsa_config.cgi' failed: /opt/lampp/cgi-bin/pbsa_config.cgi, referer: http://<>/MCB_HTML/TestBed.html
[Wed Aug 30 09:11:03.796584 2017] [cgi:error] [pid 32051] [client XX:60624] End of script output before headers: pbsa_config.cgi, referer: http://xx/MCB_HTML/TestBed.html
Try:
Disabled selinux
Given full permissions for script, but 755 will be ok
I finaly added like -w like below
#!/usr/bin/perl -w*
use CGI ':standard';
{
print header(),
...
end_html();
}
-w indictes enable all warnings.It started working, No idea why -w here.
I'm trying to run shell commands (amixer set Master 1+ for example) through web interface.
I have set up apache on the target server (Ubuntu 12.04, desktop) and tested the setup with a simple Hellow world! script. Everything works fine but if I try to do this with amixer I don't get any result. I don't even get any output though if I try to print the output to a file the file is created.
I'm not sure if this is configuration issue or a missing command issue.
How can I achieve this?
Edit:
I attach here part of /var/log/apache2/error.log which I think is relevant
amixer: Mixer attach default error: No such file or directory [Sat May
26 17:54:05 2012] [error] [client 192.168.1.103] File does not exist:
/var/www/favicon.ico
I'm sorry for the late respond, due to unexpected maintenance work, I had to leave home for several days.