I have a Form field for an Image upload, which I open with ‘files’ => true, like so: And in my Controller I want to check if a File was uploaded and do something with it: But Input::hasFile always returns false and I don’t know why. results in: I have tested around with another picture fo…
Tag: php
Laravel – Multiple User Logins Under One Main User Account
My application has the structure of monthly subscriptions that give you a single “admin” account login responsible for billing. Under that main user account, there can be numerous employees, some, …
call methods and objects using php
i have this code : in my code i don’t always want to use $test = new test …. I want to use the name directly instead of $test. For example: Answer You should use a factory method pattern or something like that. With a factory method you can create a class based on a string. In PHP it’s not
PHP: How to use monolog to log to console (php://out)?
I just switched to monolog and wanted to log my message to the PHP console instead of a file. This might seem obvious for some people, but it took me a little while to figure out how to do that and I …
Unable to start php-fpm – “cannot get uid for user ‘apache'”
On a fresh AWS Linux HVM box, I ran the commands: I then tried to sudo service start php-fpm, but got the error: Where am I going wrong and where is the apache user coming from? Answer The apache user comes from php-fpm.conf file. It does not matter that you run it as root, the service will start as the
Is session.cookie_secure in php.ini automatic?
Simple answer requested: If I put in the php.ini file for my website, will that automatically turn all the php cookies to secure and httponly, or will I still need to put in true, true into parameter slots 6 and 7 in the cookie itself? Answer The answer is yes. Setting this in php.ini is enough (however, I on…
Error executing simple select query on salesforce
I’m trying to execute a query: But I get this error: Fatal error: Uncaught SoapFault exception: [soapenv:Client] Element {}item invalid at this location in /Library/WebServer/Documents/force/soapclient/SforceBaseClient.php:797 Stack trace: #0 /Library/WebServer/Documents/force/soapclient/SforceBaseClien…
How do I create a project based on a specific version of Symfony using composer?
I want to create a project based on Symfony 2.4.6. These commands: ../composer.phar create-project symfony/framework-standard-edition=v2.4.6 ./ ../composer.phar create-project symfony/framework-…
issues printing last error message in php
I am trying to connect to a MySQL database using PHP, but I am getting 32767 error reporting in the console. I tried to show the error message using echo error_reporting() but it is not showing the …
phpMyAdmin: secret passphrase?
I am using MAMP and every time I login to phpMyAdmin, I am getting the following error/warning message: the configuration file now needs a secret passphrase (blowfish_secret). I have not messed around with any of this settings before. Can someone please clarify this error. Here is the info on my db server: Se…