I am trying to configure my beanstalk application, setting the max_input_vars=5000 in php.ini.
I found this link which does pretty close to what I want except a little different. Instead of copying from S3 I just want to create a file with that line. The below is my code in a file named phpini.config found in the .elasticbeanstalk folder.
files:
"/etc/php.d/project.ini" :
mode: "000777"
owner: root
group: root
content: |
max_input_vars=5000
However, the value is not changing, as I seen when I run phpinfo(), nor is there a project.ini file created in /etc/php.d/.
Is there something I am missing out? Or is there a way I can see if this config file is being run?
Edit
Seems like the .config file is supposed to be in .ebextensions instead of .elasticbeanstalk according to AWS Docs. Making the change didnt make things work though.
The cleanest way what we did to install a svn plugin that is to use a .ebextensions config file in my project archive:
Sample you can go like this create a file .ebextensions/eb.config file:
files:
"/etc/php.d/project.ini" :
mode: "000644"
owner: root
group: root
content: |
u max_input_vars=5000
I tried the abaid778 snippet code and does not work so I remove de 'u' before max_input_vars and that work now.
files:
"/etc/php.d/project.ini" :
mode: "000644"
owner: root
group: root
content: |
max_input_vars = 5000
I couldn't make the previous suggestions work but was able to change the php.ini value with .htaccess:
php_value max_input_vars 5000
How to set the max_input_vars directive in an .htaccess file
Related
I have issue in enable ioncube loader extension in google app engine standard envirenement,
I get this error :
NOTICE: PHP message: PHP Fatal error: [ionCube Loader] The Loader must appear as the first entry in the php.ini file in Unknown on line 0
I already added it in first of php.ini file :
zend_extension = /srv/modules/ioncube_loader_lin_7.2.so
asp_tags = Off
display_errors = Off
max_execution_time = 3600
max_input_time = 3600
max_input_vars = 1000
memory_limit = 512M
post_max_size = 128M
session.gc_maxlifetime = 1440
upload_max_filesize = 1G
zlib.output_compression = On
I think I need to add it in default php.ini file to execute at first but I dont know how to rewrite default php.ini file or replace it...
First you need to change environment to flex and use custom runtime
add dockerfile
move your app to sub directory www
create sub directory config and create empty php.ini file inside him
download ioncube loader and move it to main directory
Direcotory :
-config
php.ini
-www
app.yaml
composer.json
dockerfile
ioncube_loader_lin_7.2.so
app.yaml :
runtime: custom
env: flex
runtime_config:
document_root: www
manual_scaling:
instances: 1
resources:
cpu: 1
memory_gb: 0.5
disk_size_gb: 10
composer.json :
{
"require": {
"php": "7.2.*"
}
}
Dockerfile :
# Dockerfile extending the generic PHP image with application files for a
# single application.
FROM gcr.io/google-appengine/php:latest
# environment variable.
ENV DOCUMENT_ROOT /app/www
# copy default php.ini to txt file
RUN cp /opt/php72/lib/php.ini www/phpconfig.txt
after that deploy your application and navigate txt file url "yourdomain.com/phpconfig.txt" copy contain and add it to your config/php.ini
don't forget add ioncube in first line :
zend_extension = "/app/ioncube_loader_lin_7.2.so"
edit dockerfile again :
# Dockerfile extending the generic PHP image with application files for a
# single application.
FROM gcr.io/google-appengine/php:latest
# environment variable.
ENV DOCUMENT_ROOT /app/www
COPY config/php.ini /opt/php72/lib/php.ini
and deploy your application thats all.
I am running a website using AWS Elastic Beanstalk. In AWS Elastic Beanstalk, the default upload_max_filesize in php.ini is limited to 2M. I want to increase the upload_max_filesize to 20M. I do the following thing and 'Upload and Deploy' EBS by uploading the new application source codes with the new 99my_php_ini_change.config. But it does not automatically create the /etc/php.d/zzz_my_own_php.ini. I also
'Create New Application' using Elastic Beanstalk, but I did not see the file /etc/php.d/zzz_my_own_php.ini was successfully created either.
Where is the error?
I thing I did was:
put file 99my_php_ini_change.config inside folder .ebextensions under application root.
99my_php_ini_change.config contains :
files:
"/etc/php.d/zzz_my_own_php.ini" :
mode: "000644"
owner: root
group: root
content: |
upload_max_filesize=20M
Do you see any error messages in the log file at /var/log/eb-activity.log? You can view the full log file by doing an eb ssh, or you can retrieve it through the EB console or from the command-line using eb logs. If there are any errors, please show your log file here.
Also, YAML files are very sensitive to whitespace. You might try the following instead (notice the two spaces per indent level, lack of space before the colon, and lack of newline):
files:
"/etc/php.d/zzz_my_own_php.ini":
mode: "000644"
owner: root
group: root
content: |
upload_max_filesize=20M
I would like to increase my minimum upload filesize from 2MB to 64 MB for my php web application.. I have a config file stored in an .ebextensions directory.. While deploying to aws, an error occurred:
The configuration file .ebextensions/yep.config in application version try10 contains invalid YAML or JSON. YAML exception: while scanning a simple key in "", line 7, column 7: upload_max_filesize = 64M ^ could not found expected ':' in "", line 8, column 7: post_max_size = 64M ^ , JSON exception: Unexpected character (f) at position 0.. Update the configuration file.
Below is my config file that I am starting out with. I have spend 8 hours troubleshooting with no luck. Any help will be very much obliged.
files:
"/etc/php.ini":
mode: "000755"
owner: root
group: root
content: |
upload_max_filesize = 64M
post_max_size = 64M
I am using this successfully in an Elastic Beanstalk application. Just put the following into your yep.config file inside of your .ebextensions directory in the root of your application.
files:
"/etc/php.d/project.ini" :
mode: "000644"
owner: root
group: root
content: |
upload_max_filesize=64M
post_max_size=64M
am using Digitalocean VPS
I can't see the .htaccess file
/etc/apache2/sites-available# ls
000-default.conf default-ssl.conf dindudu.conf script.conf site.conf
how to make the .htaccess file .
Use ls -a.
ls without parameters does not list file names beginning with a dot.
And have a look at man ls.
You can simply create a new file named .htaccess in your public directory eg. /var/www/html and start using it ..
Please note you might have to mention Allowoveride All in you apache config or your virtual host file ..
Please refer this link for this https://www.digitalocean.com/community/tutorials/how-to-use-the-htaccess-file
I'm using the Elastic Beanstalk multi-container environment. I've created my own lightweight PHP7 + nginx image (https://github.com/maestrooo/eb-docker-php7) which comes with some sane PHP.ini settings (https://github.com/maestrooo/eb-docker-php7/blob/master/config/custom.ini).
However, I'd like to turn off the "opcache.validate_timestamps" option. The problem is that if I do it in the custom.ini in the image, it will also be applied on development.
I therefore wanted to be able to set it to "off" through .ebextensions file (this way it will only be deployed on production, as eb local run command ignore .ebextensions files), so I added a .ebextensions/server.config file to something like that:
files:
"/usr/local/etc/php/conf.d/project.ini":
mode: "000644"
owner: root
group: root
content: |
opcache.validate_timestamps = off
While the file is properly added to the instance, unfortunately it is still to "On". It seems because PHP needs to be restarted, but I've been unable to know how I could restart PHP in the context of the Docker multi-container environment.
Did anyone were able to do something similar?
Thanks