upload large file size(larger than 1048MB) from php using xampp and mysql - large-file-upload

I have a web application using in a local network. I made it by(php, html, mysql) and using xampp to share it in a local network, my problem is that I can't upload larger than 1GB file to database because I want to upload larger than 3GB files. I use move_uploaded_file () to move file to a directory in source folders. It not moves whoever I make changes to php.ini file like this
memory_limit=5000M
php_value post_max_size 5000M
php_value upload_max_filesize 6000M
Max_upload_time 6000
Max_execution_time 6000
I try these solutions many times but the problem is not solved hence became tired.
Please show me to solve the problem
Thanks

try to fix your code with this on php.ini :
upload_max_filesize=6000M
post_max_size=5000M
max_execution_time=6000
max_input_time=6000
Don't forget to restart your xampp after change the code. Good Luck :)

Related

TYPO3 10.4 sometimes page rendering is very slow

System:
TYPO3: 10.4.22
PHP: 7.4.30
Apache 2.4.46
Windows Server 2019
X64
Hello!
I have the issue that sometimes the page rendering is absolutely slow. I added a simple page and "normal" page generation is about 200ms. But about each 10th load of the page it is very slow - about 20 seconds.
I checked the issue in the Admin Panel and if I look at the TS-Tree I have a very big value in the Script Start row (e.g. +21075 for a 21048ms run vs. +235 for a 205ms run).
I checked the performance (memory, network, cpu of the server itself and everything looks good). I did a test when no one else was working (it is a intranet installation) so I was the only one hitting the page and run into the same issue. If I do a reload after a slow load I get a fast load immediately.
Any ideas what is happing on these slow runs?
Thank you
Christian
Try '127.0.0.1' instead of 'localhost'
(in typo3conf/LocalConfiguration.php, 'DB' => 'Connections' => 'Default' => 'host')
The problem was an old File Storage Setting. The file storage was configured as local filesystem to a directory which was a symlink to a fileshare on another server. This server was switched off. The file storage was not in use anymore but the record in TYPO3 still existed and was set to "online". I have no clue why it slew down the page loading only each 5 or 8 time....

three ways to let PHP and a regular user edit the same files

I am a web developer, and for some upcoming projects I would like to use a file-based CMS. This means that many of the files I create at the start must be editable by the PHP user later, but also remain editable for my user (and also the other way around). My PC runs Debian 9, which I love but am not super knowledgeable about, and I have also just set up a local network server with Debian 9 for backups and possibly file sharing. (I'm using Webmin to configure this, which reflects my level of command line skills).
On my online shared hosting server, the PHP user and the FTP user seem to be the same, and 644/755 permissions work fine, this is also recommended by the CMS I'm using. I would like to mimic this on my computer so I don't have to fiddle with permissions all the time. But how do I do this? Currently, my regular user (anna) does not have access to www-data's files and vice versa. Putting them in the same group still means changing file permissions. Making anna the PHP user is a Bad Idea (as far as I understand it) because anna has sudo permissions.
So far I have researched three possible solutions that I don't really know very much about, and I would like to know which is the best route to take.
Develop locally on my computer and use apache-mpm-itk or suPHP to let PHP edit the files (I got that idea from this question on ServerFault).
Develop locally on my computer and rsync the files to my server with grunt-rsync, and somehow get rsync to set the ownership to www-data (another ServerFault thread helping here).
Mount the project's server directory, which is owned by www-data, on my computer with SSHFS and then either edit the files on the server directly or copy them over from my local directory with grunt-copy.
What do you think: from a security and ease of use perspective, which is the best way? Or do you know an even better one?
Thank you for taking the time to read and think about this!
Anna~
I figured it out! I finally ended up reading about running PHP as CGI instead of as an Apache module, and that this would solve my permissions problem. Plus, as far as I understand it, there are no extra security precautions to take when I'm the only one working with it on my local computer.
In case someone comes across this who might find it helpful, here's what I did (basically following these instructions):
I installed php7.0-fpm
Edited /etc/apache2/sites-enabled/000-default.conf and put the following just before </VirtualHost>:
DirectoryIndex index.php
<LocationMatch "^(.*\.php)$">
ProxyPass fcgi://127.0.0.1:9000/var/www/html
</LocationMatch>
I activated the Apache module proxy_fcgi (via Webmin, which apparently does an automatic Apache restart)
In /etc/php/7.0/fpm/pool.d/www.conf I commented out a listen line and put another below like this:
; listen = /run/php/php7.0-fpm.sock
listen = 127.0.0.1:9000
I then restarted PHP-FPM with this command: /etc/init.d/php7.0-fpm restart (a little different from the instructions, I'm on Debian 9). After that, phpinfo() gave me the Server API "FPM/FastCGI".
And finally, I changed the user and group from www-data to anna in three places, twice in /etc/php/7.0/fpm/pool.d/www.conf and then once more in /usr/lib/tmpfiles.d/php7.0-fpm.conf (this last bit may be Ubuntu/Debian specific, my thanks go to Keith for a comment on StackExchange).
And that was it! :-)

403 Forbidden Error on MAMP

I try to run my local applications on MAMP PRO. Since now i run MAMP and everything works fine. Now i've changed to MAMP PRO because of the possibilities to generate more hosts and send email from local applications.
Now i have the problem that i can't access files in a directory. I have checked indexes under Hosts->Extended which should solve this problem. But it doesn't. I've found many articles but not anyone that solves my problem. I'm also not a specialist on server, but i think there must be a easy solution even in MAMP it works.
I've read something over Web-sharing but this was not clear described enough.
MACOSX: 10.11.2
MAMP PRO: 3.5
One failure in the log was:
"Permission denied: file permissions deny server access: /folder/file.js"
But where i can change it generally.
Thanks for your Help. I'm very confused.
codeFragment
This worked for me.
Create an index file in the directory, by default Apache is looking for such a file
If you want to access the directory (the list of your files or folders in the directory), just go in Mamp Pro to Hosts >> Advanced and check Indexes.
So simple, no need to go configure any file.
In MAMP PRO you can check the option INDEXES in Apache tab.
After restart server will work.
Sounds like a permission problem. Set the parent folder to "read only" for all and assign it to all folders/files below.
Greetings,
Peter
I had this happen to me after a cloud restore. I traced the problem to the fact that the site folder hadn't been fully restored and was mostly empty.
The solution was to repeat "Save to Cloud" from the remote computer and then repeat "Load from Cloud" on the computer I was currently using.
This case is occur when you run Mamp with the Server Nginx and nginx server needed configuration of each working folder/directory.
for the nginx configuration you can go in nginx.conf file on path
C:\MAMP\conf\nginx\nginx.conf
and write this script.
http {
.....
server {
location ~* /test(.*)$ {
root C:/MAMP/htdocs/test;
index index.php;
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:9100;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}
}
note: in this script test is my working directory. you can replace this name.
Whenever you are setting up a new server on a Mac, whether it be MAMP, MAMP PRO or just straightforward Nginx/Apache, always set the right permissions on the root folder. Permissions are used for security reasons, not a bad thing in any way although it adds layers to get things done good or bad. Nginx/Apache usually uses _www to read and write on your folder. So you must grant _www access access.
To do this for example on a folder located at /MacHD/Sites...
open up a console
sudo chown -R _www Sites
sudo chmod -R g+w Sites```
restart your server
References:
- https://ss64.com/osx/chmod.html
- https://ss64.com/osx/chown.html

Shared folder with vagrant cause invisible characters appending

I have a few invisible characters (�) that appear at the end of a javascript document that cause the "illegal character" error in FF or Chrome. I saw different topics about this error, but nothing works for me, and i can't see anything wrong in my document (displaying invisible characters, open it with a hexadecimal editor). This is just driving me crazy.
I use Vagrant with a nginx web server. The document looks clear in the server too (vi + :set list).
Plus, when I get back a clear document from my Git repository, everything works(normal). But each time I want to edit it (like create a new variable at the top of document), I got this error again.
If someone can helps me, thank you.
If you're using the VirtualBox provider, then VirtualBox shared folders are the default synced folder type. These synced folders use the VirtualBox shared folder system to sync file changes from the guest to the host and vice versa.
There is a VirtualBox bug related to sendfile which can result in corrupted or non-updating files. You should deactivate sendfile in any web servers you may be running.
In Nginx:
sendfile off;
In Apache:
EnableSendfile Off
See vagrant docs: http://docs.vagrantup.com/v2/synced-folders/virtualbox.html
It seems that you're using Vagrant.. please take a look at your _Vagrantfile and check the way files are written on the VM filesystem.
cat ~/.vagrant.d/boxes/[YOUR VM NAME]/include/_Vagrantfile
Maybe you are using config.vm.synced_folder try to use NFS:
config.vm.synced_folder "/home/myuser/shared", ".", :nfs => true

using directadmin resetting counter in counter.pl script running on website

my client side has counter.pl script running on homepage. that displays visitors counter
the client wants to change the visitor counter value.
when i checked the code in index.html,it points cgi-bin/counter.pl script
But wen i try to search cg-bin folder ther are only two files counter.jpg and .htaccess
now how to find the counter.pl script and edit ...!!!??
thanks in advance for any help
Check the web server configuration to see where the cgi-bin directory really is. If you're using apache then you want to look for something like this:
ScriptAlias /cgi-bin/
in the httpd.conf and related files. The actual cgi-bin directory is often located somewhere outside the DocumentRoot directory.