I have a simple html form which uploads .xlsx file to the web server. It works fine in localhost but not in amazon aws. Gives 500 internal server error after submitting the form.
Added below mime type line to /etc/httpd/conf/httpd.conf and restarted the apache web server
AddType application/vnd.openxmlformats-officedocument.spreadsheetml.sheet .xlsx
But still giving 500 internal server error.
Access Log
106.193.45.134 - - [11/Nov/2020:20:10:15 +0000] "GET /assets/google-fonts/nunito.css HTTP/1.1" 404 196 "http://ec2-54-254-14-220.ap-southeast-1.compute.amazonaws.com/admin/exams" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36"
106.193.45.134 - - [11/Nov/2020:20:10:15 +0000] "GET /admin/assets/images/logo.png HTTP/1.1" 404 196 "http://ec2-54-254-14-220.ap-southeast-1.compute.amazonaws.com/admin/exams" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36"
106.193.45.134 - - [11/Nov/2020:20:10:21 +0000] "GET /admin/add-questions?node=EX-803724 HTTP/1.1" 200 33642 "http://ec2-54-254-14-220.ap-southeast-1.compute.amazonaws.com/admin/exams" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36"
106.193.45.134 - - [11/Nov/2020:20:10:21 +0000] "GET /assets/google-fonts/nunito.css HTTP/1.1" 404 196 "http://ec2-54-254-14-220.ap-southeast-1.compute.amazonaws.com/admin/add-questions?node=EX-803724" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36"
106.193.45.134 - - [11/Nov/2020:20:10:22 +0000] "GET /assets/js/validation/custom.js HTTP/1.1" 304 - "http://ec2-54-254-14-220.ap-southeast-1.compute.amazonaws.com/admin/add-questions?node=EX-803724" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36"
106.193.45.134 - - [11/Nov/2020:20:10:22 +0000] "GET /admin/assets/images/logo.png HTTP/1.1" 404 196 "http://ec2-54-254-14-220.ap-southeast-1.compute.amazonaws.com/admin/add-questions?node=EX-803724" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36"
106.193.45.134 - - [11/Nov/2020:20:10:32 +0000] "POST /admin/app/import-question.php HTTP/1.1" 500 - "http://ec2-54-254-14-220.ap-southeast-1.compute.amazonaws.com/admin/add-questions?node=EX-803724" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36"
106.193.45.134 - - [11/Nov/2020:20:11:21 +0000] "POST /admin/app/import-question.php HTTP/1.1" 500 - "http://ec2-54-254-14-220.ap-southeast-1.compute.amazonaws.com/admin/add-questions?node=EX-803724" "Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36"
106.193.45.134 - - [11/Nov/2020:20:12:24 +0000] "-" 408 - "-" "-"
Error log
[Sun Nov 08 03:28:01.164234 2020] [lbmethod_heartbeat:notice] [pid 11174] AH02282: No slotmem from mod_heartmonitor
[Sun Nov 08 03:28:01.164288 2020] [http2:warn] [pid 11174] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive.
[Sun Nov 08 03:28:01.164294 2020] [http2:warn] [pid 11174] AH02951: mod_ssl does not seem to be enabled
[Sun Nov 08 03:28:01.168564 2020] [mpm_prefork:notice] [pid 11174] AH00163: Apache/2.4.46 () configured -- resuming normal operations
[Sun Nov 08 03:28:01.168576 2020] [core:notice] [pid 11174] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Mon Nov 09 00:37:39.754360 2020] [proxy_fcgi:error] [pid 24378] [client 150.136.192.92:39689] AH01071: Got error 'Primary script unknown\n'
[Tue Nov 10 01:53:56.920943 2020] [proxy_fcgi:error] [pid 24350] [client 106.13.118.194:54806] AH01071: Got error 'Primary script unknown\n'
[Wed Nov 11 13:52:21.182692 2020] [proxy_fcgi:error] [pid 319] [client 169.45.99.50:59122] AH01071: Got error 'Primary script unknown\n'
[Wed Nov 11 13:54:29.578626 2020] [proxy_fcgi:error] [pid 302] [client 169.45.99.50:57770] AH01071: Got error 'Primary script unknown\n'
[Wed Nov 11 13:54:29.579326 2020] [proxy_fcgi:error] [pid 24378] [client 169.45.99.50:57772] AH01071: Got error 'Primary script unknown\n'
[Wed Nov 11 14:42:03.952827 2020] [core:alert] [pid 3857] [client 106.193.45.134:7908] /var/www/html/.htaccess: AddType requires at least two arguments, a mime type followed by one or more file extensions, referer: http://ec2-54-254-14-220.ap-southeast-1.compute.amazonaws.com/admin/add-questions?node=EX-803724
[Wed Nov 11 14:42:11.233041 2020] [core:alert] [pid 25769] [client 106.193.45.134:7909] /var/www/html/.htaccess: AddType requires at least two arguments, a mime type followed by one or more file extensions
[Wed Nov 11 14:42:17.225650 2020] [core:alert] [pid 24330] [client 106.193.45.134:7913] /var/www/html/.htaccess: AddType requires at least two arguments, a mime type followed by one or more file extensions
[Wed Nov 11 15:12:03.140625 2020] [mpm_prefork:notice] [pid 11174] AH00170: caught SIGWINCH, shutting down gracefully
[Wed Nov 11 15:24:56.800211 2020] [suexec:notice] [pid 12386] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed Nov 11 15:24:56.816223 2020] [lbmethod_heartbeat:notice] [pid 12386] AH02282: No slotmem from mod_heartmonitor
[Wed Nov 11 15:24:56.816270 2020] [http2:warn] [pid 12386] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive.
[Wed Nov 11 15:24:56.816276 2020] [http2:warn] [pid 12386] AH02951: mod_ssl does not seem to be enabled
[Wed Nov 11 15:24:56.818907 2020] [mpm_prefork:notice] [pid 12386] AH00163: Apache/2.4.46 () configured -- resuming normal operations
[Wed Nov 11 15:24:56.818930 2020] [core:notice] [pid 12386] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Wed Nov 11 15:28:05.126291 2020] [mpm_prefork:notice] [pid 12386] AH00170: caught SIGWINCH, shutting down gracefully
[Wed Nov 11 15:28:06.178758 2020] [suexec:notice] [pid 12467] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed Nov 11 15:28:06.194217 2020] [lbmethod_heartbeat:notice] [pid 12467] AH02282: No slotmem from mod_heartmonitor
[Wed Nov 11 15:28:06.194265 2020] [http2:warn] [pid 12467] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive.
[Wed Nov 11 15:28:06.194277 2020] [http2:warn] [pid 12467] AH02951: mod_ssl does not seem to be enabled
[Wed Nov 11 15:28:06.196829 2020] [mpm_prefork:notice] [pid 12467] AH00163: Apache/2.4.46 () configured -- resuming normal operations
[Wed Nov 11 15:28:06.196853 2020] [core:notice] [pid 12467] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Wed Nov 11 20:04:20.990338 2020] [proxy_fcgi:error] [pid 12468] [client 130.61.96.72:22196] AH01071: Got error 'Primary script unknown\n'
Screenshot headers problem due to header?? there is no xlsx mime type!!!
[12-Nov-2020 04:57:10 UTC] PHP Notice: Undefined index: role in /var/www/html/admin/add-questions.php on line 159
[12-Nov-2020 04:57:10 UTC] PHP Notice: Undefined index: role in /var/www/html/admin/add-questions.php on line 176
[12-Nov-2020 04:57:10 UTC] PHP Notice: Undefined index: role in /var/www/html/admin/add-questions.php on line 192
[12-Nov-2020 11:12:02 UTC] PHP Notice: Undefined index: avator in /var/www/html/assets/app/auth.php on line 85
[12-Nov-2020 11:12:15 UTC] PHP Fatal error: Uncaught Error: Call to undefined function simplexml_load_string() in /var/www/html/admin/constants/SimpleXLSX.php:542
Stack trace:
#0 /var/www/html/admin/constants/SimpleXLSX.php(416): SimpleXLSX->getEntryXML('_rels/.rels')
#1 /var/www/html/admin/constants/SimpleXLSX.php(206): SimpleXLSX->_parse()
#2 /var/www/html/admin/app/import-question.php(12): SimpleXLSX::parse('/tmp/phpVZdYx2')
Installed php-xml package, after that it worked.. thanks Aleksander Wons
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.
PHP (from the English Hypertext Preprocessor - hypertext preprocessor) is a scripting programming language for developing web applications. Supported by most hosting providers, it is one of the most popular tools for creating dynamic websites.
The PHP scripting language has gained wide popularity due to its processing speed, simplicity, cross-platform, functionality and distribution of source codes under its own license.
https://www.php.net/
CSS (Cascading Style Sheets) is a formal language for describing the appearance of a document written using a markup language.
It is mainly used as a means of describing, decorating the appearance of web pages written using HTML and XHTML markup languages, but can also be applied to any XML documents, such as SVG or XUL.
https://www.w3.org/TR/CSS/#css
HTML (English "hyper text markup language" - hypertext markup language) is a special markup language that is used to create sites on the Internet.
Browsers understand html perfectly and can interpret it in an understandable way. In general, any page on the site is html-code, which the browser translates into a user-friendly form. By the way, the code of any page is available to everyone.
https://www.w3.org/html/
Welcome to the Q&A site for web developers. Here you can ask a question about the problem you are facing and get answers from other experts. We have created a user-friendly interface so that you can quickly and free of charge ask a question about a web programming problem. We also invite other experts to join our community and help other members who ask questions. In addition, you can use our search for questions with a solution.
Ask about the real problem you are facing. Describe in detail what you are doing and what you want to achieve.
Our goal is to create a strong community in which everyone will support each other. If you find a question and know the answer to it, help others with your knowledge.