Pages

Help creating script to create php.ini file

mercredi 17 août 2016

I'm trying to write a script to create a php.ini file so I don't have to edit the php.ini each time I do an install. I'm using Ubuntu 16.04. I've used filezilla to copy the edited php.ini to my windows 10 computer and I'm using notepad ++ with Edit/EOL set to unix. I then create the script file with nano in an ssh session and copy the code from the clipboard into the script file in Ubuntu.

Code:

sudo echo '[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini   ;
;;;;;;;;;;;;;;;;;;;
; PHPs initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHPs behavior.


; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
; 1. SAPI module specific location.
; 2. The PHPRC environment variable. (As of PHP 5.2.0)
; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0)
; 4. Current working directory (except CLI)
; 5. The web servers directory (for SAPI modules), or directory of PHP
; (otherwise in Windows)
; 6. The directory from the --with-config-file-path compile time option, or the
; Windows directory (C:\windows or C:\winnt)
; See the PHP docs for more specific information.
; http://ift.tt/1hvKJSm ............

; Local Variables:
; tab-width: 4
; End:' > php.ini
sudo mv php.ini /etc/php/7.0/fpm/
This is the error I get

Code:

sudo echo [PHP]: No such file or directory./c3.sh: line 209: syntax error near unexpected token `;;'
./c3.sh: line 209: `;;;;;;;;;;;;;;;;;;;'
The line of code that is underlined is line 209. I wasn't sure if other ' marks like in php's etc caused a problem so I removed them except from the beginning and end of the code. Not sure what the issue is. Thanks in advance.

Let's block ads! (Why?)



Help creating script to create php.ini file

Aucun commentaire:

Enregistrer un commentaire