logs archiveIRC Archive / Freenode / #php / 2015 / June / 26 / 1
abishek
could somebody advice on why PHP returns an empty array for this example https://eval.in/387939
sorry, I meant empty string on the 1st key
lostsnow
abishek: If you split an empty string, you get back a one-element array with 0 as the key and an empty string for the value. http://php.net/manual/en/function.explode.php#99830
tuskkk___
How to deal with spaces in file names when passing the url to file_get_contents, it works fine on my environment, but break at staging
breaks*
fleetfox
it's uri or system path?
url*
encode / escape
tuskkk___
fleetfox: system path
urlencode didnt work well
fleetfox
file\ name
tuskkk___
but sometimes I may get the folder name too in that controller, so how to effectively escape it?, e.g $fileName = 'space test' or $filename = 'spacefolder/space test'
mrtakdeniz
hey there
there is a script which is not working on my local environment, but working well on my server
i installed same operation system, same configurations etc., still not working
any idea why?
blondie101010
isn't DOMdocument supposed to handle embedded scripting?
mrtakdeniz: you need to pinpoint what is the difference as there obviously is one
diff the phpinfo results to begin
         

mrtakdeniz
blondie101010, i've a script which parses phpinfo values
and says differences
there is no difference at all, whole config is same
blondie101010
what works differently then?
fleetfox
read the error log?
blondie101010
I would probably put traces to identify the operating difference
mrtakdeniz
fleetfox, yeah, i did. it says one class is not found, but same code (cloned from git) worked well on server, so i don't think it is a class problem
fleetfox
it probably has nothing to do with server
but your configuration or deployment
mrtakdeniz
blondie101010, wait a min please, there was only 1 difference need to check it
fleetfox
make sure that calss is there, then make sure your autloader has up to date cache
blondie101010
fleetfox: are you familiar with DOMdocument?
fleetfox
to an extent
blondie101010
http://codepad.viper-7.com/Y7ZjfN
mrtakdeniz
fleetfox, if class was missing, shouldn't work on server also, right?
fleetfox, let me check autoloader
blondie101010
mrtakdeniz: what he's saying is that you don't have the same environment on both systems
do a diff between the 2 folders
mrtakdeniz
actually, as i say there is no any differences on folders or files
fleetfox
make sure it's there
mrtakdeniz
i cloned both of them from git
fleetfox
is that too hard for you
?
mrtakdeniz
at the same time
nope, let me check it fleetfox
blondie101010
mrtakdeniz: did you or didn't you put each folder side by side and diff them?
mrtakdeniz
not yet blondie101010, working on it
         

blondie101010
good
fleetfox: did you look at my paste, causing DOMdocument to bug is too easy
I kind of hope to find a magic option to get it working properly
otherwise I guess I'll go back to manual parsing :)
fleetfox
blondie101010: try specifying doctype
blondie101010
sure but it won't change it
it's the same thing: http://codepad.viper-7.com/8FYmGS
mrtakdeniz
fleetfox, blondie101010 there are differences
blondie101010
of course! :)
fleetfox
no sh*t
mrtakdeniz
because of cache folders and files
script has smarty, and worked on server and created cache and compile files
and on local, didn't work -actually php works i think, because it redirects me if i didn't login to login page-
but on view, there is always class not found fatal error
and no compiled or cached file on file system
i think it is a problem of smarty
or missing component, phpinfo diff says there is no any missing module..
blondie101010
smarty doesn't control your PHP class loading, does it?
mrtakdeniz
error says it is smarty's class
Fatal error: Class 'Smarty_Internal_SmartyTemplateCompiler' not found in /home/mew/sportive/tools/smarty/sysplugins/smarty_internal_template.php on line 671
chmod and chown settings are 777
folder owned by www-data
blondie101010
mrtakdeniz: and did you locate the class file in both installations?
mrtakdeniz
yep
i downloaded at least 4 times to both server and local
blondie101010
sounds like a difference in the autoloader
mrtakdeniz
i am sure about class files
as i say, php side working well i think, because when i try to go admin url
it redirects me automatically to index.php?controller=AdminLogin&token=de18672b78bd3e467b3c23a5ee987bac&redirect=AdminDashboard
which is login page
am i right?
let me check both autoloader files blondie101010
blondie101010
the php engine may be working but not your script
Bad_Advice_Cat: what do you think of DOMdocument's trouble handling scripting? http://codepad.viper-7.com/8FYmGS
fleetfox
blondie101010: libxml chokes on that closing </html> in alert not the script tag
mrtakdeniz
guys, i figured out the problem
smarty is not compling at all
and autoload files are same
is there a way to copy php installation from server to local
blondie101010
fleetfox: of course, it was done that way intentionnally and if it supported scripting, it would know it's between quotes and not actual tags
fleetfox
are you sur it's valid markup?
blondie101010
let me run an html validator on it :)
fleetfox
https://mail.gnome.org/archives/xml/2012-July/msg00042.html
it's either not valid html or libxml issue
nothing to do with php
blondie101010
fleetfox: that's an interesting link and it does show the problem to be more generalized than with PHP but it's still a common issue
the solution offered will certainly fail on many pages as well
mrtakdeniz
blondie101010, fleetfox is there a way to copy whole php installation to local?
fleetfox
issue is not with your installation
rebuild your caches
blondie101010
mrtakdeniz: try to just copy the source folder structure
fleetfox
..
caches may have absolute paths in them
mrtakdeniz
fleetfox, what you mean by caches?
1 2 3 4 5 6 7 8 9 10 11 12 next »