Tag Archives: file

Could not open input file: artisan

Questions: When trying to create a new laravel project, The following error appears on the CLI: Could not open input file: artisan Script php artisan clear-compiled handling the post-install-cmd event returned with an error I am using the latest version of XAMPP v3.2.1 with PHP 5.5.15 and with mcrypt enabled (made sure of that by… Read More »

How to trigger XDebug profiler for a command line PHP script?

Questions: XDebug offers the configuration directive “xdebug.profiler_enable_trigger” that allows to activate profiling by passing the GET or POST parameter “XDEBUG_PROFILE” when calling a script via HTTP. This is handy if you don’t want profiling for ALL of your scripts but only for a few special cases without always changing your PHP configuration. Is there a… Read More »

how to get client side path of the uploded file

Questions: I have a form that uploads files, i need to get client side path to file? server path i could get from php array $_FILES $_FILES[“UploadFileName”][“tmp_name”] how to get client side path to file stored on a client computer? <form method=”POST” action=”upload.php” enctype=”multipart/form-data”> <p>File to upload : <input type =”file” name = “UploadFileName”></p><br />… Read More »

Including files using relative paths with PHP?

Questions: When developing my website I called all the includes in my php files by calling one single file called includes. The code of this file looked somethig like this: (I adapted it from a Lynda tutorial) defined(‘DS’) ? null : define(‘DS’, DIRECTORY_SEPARATOR); defined(‘SITE_ROOT’) ? null : define(‘SITE_ROOT’, ‘C:’.DS.’wamp’.DS.’www’.DS.’ArmyCreator’); defined(‘LIB_PATH’) ? null : define(‘LIB_PATH’, SITE_ROOT.DS.’includes’);… Read More »

limiting the checking condition while uploading swf files

Questions: i am creating an application of uploading swf files in a folder using php.. my script is all working except for the first if condition where i’m checking whether the extension is swf or not…but i seems to have some error…i’m not sure whether video/swf is a valid checking parameter for swf files or… Read More »

upload image $_FILES is not set

Questions: I’m trying to upload a file to my server But the problem is the if(isset($_FILES[‘upl’])) always returns false my php: if($_SERVER[‘REQUEST_METHOD’] == ‘POST’) $allowed = array(‘png’, ‘jpg’, ‘gif’, ‘jpeg’, ‘bmp’); { if(isset($_FILES[‘upl’]) ) { echo ‘test’; $extension = pathinfo($_FILES[‘upl’][‘name’], PATHINFO_EXTENSION); if(!in_array(strtolower($extension), $allowed)){ echo json_encode(array(‘success’=> false, ‘message’=> ‘No supported file type’)); exit; } $filename =… Read More »

multi image upload wrong quantity on file-upload

Questions: i like to upload some images to a directory with the help of arrays. therefore i have this code: $allowedExtensions = array(‘jpg’, ‘jpeg’, ‘png’, ‘bmp’, ‘tiff’, ‘gif’); $maxSize = 2097152; $Dir = “a/b/c/d”; $storageDir = “a/b/c/d/tmp_images”; //Arrays $errors2 = $output = array(); if(!empty($_FILES[‘image’])){ // Validation loop (I prefer for loops for this specific task)… Read More »

Does Google crawl include/require files in PHP?

Questions: I am new to php and I am working on a website using php that has a navigation bar. This website is going to be fairly large (above 30 pages) and I don’t want to have to change my navigation bar on every single page if I ever find a need to change it.… Read More »