My problem relates to the php.ini file I believe, but it may be another thing.

Let us say there exists a site architecture where within the root directory there's another directory named img along with a file named index.php. Within the directory img there's personal files named image.jpg.

So in index.php, to consult a picture, I'd use /img/image.jpg.

My real question is, what must i alternation in php.ini to have the ability to write img/image.jpg rather than /img/image.jpg.

Thanks

Relative pathways get resolved through the internet browser, not by PHP. There's not a way to override this behavior on the internet server.

Nothing PHP can perform. You can basically do this with Apache rewrites however it makes a lot more sense to simply use absolute pathways. You shouldn't attempt to mix absolute and relative pathways since it is only going to create problems for you personally later on. Wrong with adding the '/' towards the front from the path?

Not just that, however it will confuse the hell from people attempting to debug your code that all your relative pathways have become absolute pathways in Apache.

My real question is, what must i alternation in php.ini to have the ability to write img/image.jpg rather than /img/image.jpg.

This really is responding to your question although not the solution you want to hear. It fairly simple, let us first list the ini configurations:

  1. [cde] (most likely together with [cde])

And that is all. How it operates:

Prepend a php script using the ini directive. within that file, you start output loading with your personal callback function:

auto_prepend_file

You can now write include_path rather than function callback($buffer) { // slash that image that you want to write without slash return (str_replace("img/image.jpg", "/img/image.jpg", $buffer)); } ob_start("callback"); since your output filter function does re-write it for you personally.

But be mindful that you are not attempting to fix the incorrect finish with this particular. General rule of hypertext references apply, see Uniform Resource Identifier (URI): Generic Syntax , Hypertext Transfer Protocol -- HTTP/1.1 and Hypertext Markup Language - 2.0 .