pathinfo

nginx path_info in alias environemnt

邮差的信 提交于 2021-02-11 13:06:07
问题 I need to get this working on nginx with php-fpm: example.com/studip/dispatch.php/admin/user/ The Problem seems to be, that /studip isn't a subfolder under root but a alias to /usr/local/studip/public/ Here's the configuration without the (non working) path_info foo: server { listen 80; server_name example.com; root /var/www/example.com/htdocs; index index.php # Here are a few other subfolders hosted # ... # ... # and now studip: location /studip { alias /usr/local/studip/public/; index index

nginx path_info in alias environemnt

烂漫一生 提交于 2021-02-11 13:03:32
问题 I need to get this working on nginx with php-fpm: example.com/studip/dispatch.php/admin/user/ The Problem seems to be, that /studip isn't a subfolder under root but a alias to /usr/local/studip/public/ Here's the configuration without the (non working) path_info foo: server { listen 80; server_name example.com; root /var/www/example.com/htdocs; index index.php # Here are a few other subfolders hosted # ... # ... # and now studip: location /studip { alias /usr/local/studip/public/; index index

.htaccess rewriting PATH_INFO vars to empty before passing to template; not removing index.php from url

旧巷老猫 提交于 2021-02-10 17:50:44
问题 Morning everyone, I'm hoping this will be an easy one! (I haven't even had coffee yet why am I up so early?!) Anyway.. got a two-parter for you: First (basic) issue that I'm trying to remove index.php from my links (which seems to be next to impossible thanks hostgator :) ). After a bunch of searching I've gotten to the point where /page redirects to /index.php/page. Now this is better than nothing, but of course still not ideal. And I had to use [R] to do it. My .htaccess is: RewriteCond %

Symfony2 get path info of URL explicitely

与世无争的帅哥 提交于 2020-01-15 07:18:08
问题 Say, I have an URL http://server/mysite/web/app_dev.php/resource/1 . I am doing a GET request and the corresponding action is ResourceController::getAction . In this controller action if I call $request->getPathInfo() , it gives me /resource/1 . But in the same controller if I create a Request object with a url of another resource and call getPathInfo() it returns a longer version. $request = Request::create('http://server/mysite/web/app_dev.php/another_resource/1'); echo $request-

How to use pathinfo in php?

a 夏天 提交于 2019-12-25 01:24:54
问题 I am working on a php code as shown below on which Line#A prints the following array (shown below php code). My code doesn't seems to go inside switch statement. I am not sure why. I added print_r($parts) at Line A in order to print the value of $parts. php code: <?php if (!empty($_POST['id'])) { for($i=0; $i <count($mp4_files); $i++) { if($i == $_POST['id']) { $f = $mp4_files[$i]; $parts = pathinfo($f); print_r($parts); // Line A switch ($parts['extension']) { echo "Hello World"; // Line B

Problem using unicode in URLs with cgi.PATH_INFO in ColdFusion

爷,独闯天下 提交于 2019-12-22 08:52:49
问题 My ColdFusion (MX7 on IIS 6) site has search functionality which appends the search term to the URL e.g. http://www.example.com/search.cfm/searchterm . The problem I'm running into is this is a multilingual site, so the search term may be in another language e.g. القاهرة leading to a search URL such as http://www.example.com/search.cfm/القاهرة The problem is when I come to retrieve the search term from the URL. I'm using cgi.PATH_INFO to retrieve the path of the search page and the search

php pathinfo() expects parameter 1 to be string, array given in [duplicate]

末鹿安然 提交于 2019-12-20 07:56:22
问题 This question already has answers here : Reference - What does this error mean in PHP? (35 answers) Closed 5 years ago . I have a script that has the error-- pathinfo() expects parameter 1 to be string, array given in C:\xampp\htdocs\sitename\index.php on line 4-- , how to fix a script is <?php $dir = 'dir1/dir2/dir3/dir4/'; $phpfiles = glob($dir ."*.php"); line error ---> $pathinfo= pathinfo($phpfiles, PATHINFO_FILENAME ); foreach ($phpfiles as $phpfile){ echo '<li><a href="'.$phpfile.'">'.

Getting the file name from a text file after string matching - PHP

爷,独闯天下 提交于 2019-12-12 05:49:44
问题 I have a log file ( log.txt ) in the form: ========================================= March 01 2050 13:05:00 log v.2.6 General Option: [default] log_options.xml ========================================= Loaded options from xml file: '/the/path/of/log_options.xml' printPDF started PDF export PDF file created:'/path/of/file.1.pdf' postProcessingDocument started INDD file removed:'/path/of/file.1.indd' Error opening document: '/path/of/some/filesomething.indd':Error: file doesnt exist or no

$_SERVER['PATH_INFO] variable failing due to mod_rewrite

核能气质少年 提交于 2019-12-11 20:36:58
问题 I'm currently trying to set up a little routing system but when I rewrite my public/index.php to just public/ my $_SERVER['PATH_INFO] variable fails to get any input. It works fine without the .htaccess file when I visit: public/index.php/hello I get: Welcome! This is the main page. But when I rewrite to remove index.php and only leave public/ I am dead in the water. Does anybody know a fix for this or can someone give me an explanation for it? Simple routing script that echoes content based

PATH_INFO in PHP without having file apparent

。_饼干妹妹 提交于 2019-12-11 16:49:36
问题 I have a simple script: index.php: <?php $path= $_SERVER['PATH_INFO']; if($path) echo $path; else echo "No Path Info"; ?> When I run it like so www.website.com/index.php it works. ie) www.website.com/index.php/hello will echo /hello However, if I go to www.website.com/hello , I get a URL not found error when what I want is that /hello is echoed. How do I make it so that index.php doesn't have to be present for PATH_INFO to work?! 回答1: When a webpage is requested from a server. The server