Skip to content

Tag: php

Setting the right timezone, server and PHP

I need to set the right timezone. But I don’t understand if there is any difference between the PHP timezone (date_default_timezone_set()) and the Linux setting. Suppose I run a new AWS instance from N.Virginia. The default timezone of that server should be UTC-05:00 Does this mean that I have to set UT…

PHP / Linux shell unwanted character

I have an HTML form (field with multiple lines) that feeds a PHP code that will read each line of the field, and generate a pdf file using the line string as name. My problem is that all but the last file have a trailing ‘?’ at the end of the file. I think that somehow the form is sending

How to install hook in server?

I use Bitnami for local webserver I want try this system. But I have no experience with this script, I want understand how I can install it on my localhost. The documentation describe: how I should execute this command? Someone could explain me? Answer Bitnami developer here If you have installed an AMP Stack…

How to Grep for special characters in Linux

I wanna grep this $_SESSION[“sig”] in Linux, and find out all of files with this variable. I used but they are not working How can I fix this? Thank you. Answer Just use the grep -F ‘$_SESSION[“sig”]’ * command.

CHange php 5.4 to 5.5 on Hostgator

Currently on composer install I get the error need 5.5.9 but using 5.4 but on Hostgator cpanal it’s set as 5.5 On php -v I get On php –ini I get When going into /opt/ There is a php54, php55 and php56 How do I change my version to 5.5 I saw the following example on this link But when

Cannot pass STDIN using shell_exec() in PHP

I am a complete beginner in PHP. I want to execute a java .jar file using PHP.The jar file takes input from STDIN and generates the output at STDOUT.To execute the jar file this is what I do in my Ubuntu Linux terminal: This works perfect.However when I replicate this in PHP as: This sends $p the output gener…

Specify output names on multiple files with curl using ranges

I am trying to download a few hundred URL’s and specify the output name for each, the only difference is an ID in the URL, such as ..something/1/something.., ..something/3/something.., ..something/4/something.. etc. I can use -o filename.zip but it will overwrite for each of the range of files, I am cur…